home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / DOSREF33.ZIP / CHAPTER.003 < prev    next >
Text File  |  1994-01-20  |  138KB  |  3,106 lines

  1.  
  2.    **  Programmer's Technical Reference for MSDOS and the IBM PC **
  3.             USA copyright TXG 392-616  ALL RIGHTS RESERVED
  4.  ──────────────────────────┤ DOSREF (tm) ├───────────────────────────
  5.                  ISBN 1-878830-02-3 (disk-based text)
  6.                 Copyright (c) 1987, 1994 Dave Williams
  7.                    ┌─────────────────────────────┐
  8.                    │ Shareware Version, 01/20/94 │
  9.                    │  Please Register Your Copy  │
  10.                    └─────────────────────────────┘
  11.  
  12.                       C H A P T E R    T H R E E
  13.  
  14.  
  15.     R O M    B I O S   A N D   S E R V I C E   I N T E R R U P T S
  16.  
  17.  
  18.                             C O N T E N T S
  19.  
  20.  
  21. Calling the ROM BIOS ............................................ 3**1
  22. Interrupt 10h  Video Services ................................... 3**2
  23. Interrupt 11h  Equipment Check .................................. 3**3
  24. Interrupt 12h  Memory Size ...................................... 3**4
  25. Interrupt 13h  Disk Functions ................................... 3**5
  26. Interrupt 14h  Initialize and Access Serial Port ................ 3**6
  27.                FOSSIL Drivers ................................... 3**7
  28. Interrupt 15h  Cassette I/O ..................................... 3**8
  29. Interrupt 16h  Keyboard I/O ..................................... 3**9
  30. Interrupt 17h  Printer .......................................... 3**10
  31. Interrupt 18h  ROM BASIC ........................................ 3**11
  32. Interrupt 19h  Bootstrap Loader ................................. 3**12
  33. Interrupt 1Ah  Time of Day ...................................... 3**13
  34. Interrupt 1Bh  Control-Break .................................... 3**14
  35. Interrupt 1Ch  Timer Tick ....................................... 3**15
  36. Interrupt 1Dh  Vector of Video Initialization Parameters ........ 3**16
  37. Interrupt 1Eh  Vector of Diskette Controller Parameters ......... 3**17
  38. Interrupt 1Fh  Ptr to Graphics Char Extensions (Graphics Set 2) . 3**18
  39.  
  40.  
  41.  
  42.   The ROM BIOS is the lowest level of software access.  It contains 
  43. the following routines: 
  44.  
  45.    (all)
  46.         power-on self-test (POST)
  47.         boostrap loader
  48.         clock
  49.         floppy disk I/O
  50.         video I/O
  51.         keyboard
  52.         serial ports
  53.         parallel ports
  54.         print screen
  55.         equipment check
  56.         report memory size
  57.  
  58.  
  59.     (AT)
  60.         hard disk I/O
  61.         report memory size (extended memory)
  62.         extended memory block moves
  63.         enhanced video and keyboard I/O
  64.         high resolution timer
  65.         alarm
  66.  
  67.   Machines such as the PC Convertible, PCjr, and non-IBM machines add 
  68. additional functions. 
  69.  
  70.  
  71. Calling the ROM BIOS ............................................ 3**1
  72.  
  73.   The BIOS services are invoked by placing the number of the desired 
  74. function in register AH, subfunction in AL, setting the other 
  75. registers to any specific requirements of the function, and invoking 
  76. any of ints 10h through int 1Fh. 
  77.  
  78.   The original IBM PC Technical Reference gave the absolute addresses 
  79. of the ROM routines.  Some early software jumped directly to these 
  80. addresses, with mixed results on non-IBM BIOSes.  This practice was 
  81. common on machines predating the PC, but there is no practical use for 
  82. it now.  The OS/2 1.x Compatibility Box also does not support jumping 
  83. directly into the ROM. 
  84.  
  85.   When the interrupt is called, all register and flag values are 
  86. pushed into the stack.  The interrupt address contains a pointer into 
  87. an absolute address in the ROM BIOS chip address space.  This location 
  88. may be further vectored into the IBMBIO.COM (or equivalent) file or 
  89. user file. 
  90.  
  91.   At power-up, many BIOSes point unused interrupt vectors to zero.  
  92. Others point to an interrupt handler routine, usually just an IRET 
  93. instruction.  Still others don't even make an attempt to initialize 
  94. unused vectors.  A common programming mistake is to expect 
  95. uninitialized vectors will be zero. 
  96.  
  97.   The address vector points to a particular BIOS command handler.  The 
  98. handler pops the register values, compares them to its list of 
  99. functions, and executes the function if valid.  When the function is 
  100. complete, it may pass values back to the command handler.  The handler 
  101. will push the values into the stack and then return control to the 
  102. calling program. 
  103.  
  104.   Most functions will return an error code; some return more 
  105. information.  Details are contained in the listings for the individual 
  106. functions. 
  107.  
  108.   Register settings listed are the ones used by the BIOS.  Some 
  109. functions will return with garbage values in unused registers.  Do not 
  110. test for values in unspecified registers; your program may exhibit odd 
  111. behavior. 
  112.  
  113.  
  114.   Three sets of BIOS routines are available: PC BIOS, AT BIOS (also 
  115. called CBIOS or "Old compatibility BIOS", and the PS/2 ABIOS "Advanced 
  116. BIOS". 
  117.  
  118.   The Advanced BIOS is contained in PS/2 ROMs.  It is primarily 
  119. intended for OS use rather than application use.  OS/2 can take 
  120. advantage of ABIOS routines to reduce RAM use on PS/2 systems.  The 
  121. ABIOS can be replaced by disk and RAM based ABIOS code if desired.  
  122. There is a new BIOS Data Area defined in high memory that occupies one 
  123. K of RAM.  In OS/2 systems, parts of the ABIOS are replaced by OS/2 
  124. drivers. 
  125.  
  126.   While the CBIOS must be addressed via pointers, the routines in the 
  127. ABIOS are fixed in absolute locations so they can be referenced 
  128. directly by OS/2. 
  129.  
  130.   The ABIOS can run in protected mode, and is fully reentrant.  It 
  131. supports three types of function requests - single staged, discrete 
  132. multistaged, or continuous multistaged.  A single-staged request does 
  133. its job immediately and returns control to the caller.  A discrete 
  134. multistaged request may happen in two or more stages with pauses 
  135. between the stages.  The caller may regain control during the pauses.  
  136. A continuous multistaged request starts a staged operation that never 
  137. ends. (sometimes called a daemon). 
  138.  
  139.   Unlike the CBIOS which is called with software interrupts, ABIOS is 
  140. accessed with FAR calls.  ABIOS calls are completely reentrant in both 
  141. real and protected modes.  To call an ABIOS function, the calling 
  142. program must pass pointers to two data structures - a request block 
  143. and a common data area.  The request block specifies the desired 
  144. function number and the common data area is a table that contains 
  145. pointers to all the ABIOS' other tables and data areas.  The common 
  146. data area's internal structure contains the function transfer tables 
  147. which have the addresses of the BIOS routines. 
  148.  
  149. ABIOS stack frame and calling conventions:
  150.        bytes        stack contents
  151.         2       common data area pointer (segment/selector only)
  152.                 required
  153.         4       request block pointer - required
  154.         4       function transfer table pointer - furnished by ABIOS
  155.                 or caller
  156.         4       device block pointer - furnished by ABIOS or caller
  157.         4       return address
  158.  
  159.   In ABIOS Transfer Convention, only the first two items are required. 
  160. ABIOS assigns the second two.  In Operating System Transfer 
  161. Convention, the caller provides the second two.  Since the parameters 
  162. are not removed from the stack on return to the caller, the operating 
  163. system may save the function transfer table and device addresses after 
  164. they have been furnished by the ABIOS by a call. 
  165.  
  166.   ABIOS does no interrupt arbitration.  It assumes all interrupts are 
  167. handled by the caller or the OS and it is called only for service.  If 
  168. more than one device is sharing a hardware interrupt, the OS must 
  169. determine which interrupt is valid for the ABIOS. 
  170.  
  171.   OS/2 may use the ABIOS if found, but otherwise duplicates the BIOS 
  172. calls for the DOS Compatibility Box by vectoring BIOS calls into its 
  173. own device drivers.  This makes it rather difficult for DOS drivers 
  174. for mass storage, high resolution video boards, multitasking APIs 
  175. using int 15h, etc.  If your software needs to manipulate hardware 
  176. directly you might want to check if your code is running under OS/2.  
  177. The simplest method is to check for DOS version 10 or higher. 
  178.  
  179.  
  180. note    Some references list an "XT/2" machine, which was reputedly
  181.         an 8mHz 8088 with 640k and a clock on the motherboard.  IBM
  182.         doesn't list such a machine, and I have a late '86 XT, one of
  183.         the last made.  It is pretty much like the older ones.
  184.  
  185.  
  186. ┌─────────────────────────────────────────────────────────────────────┐
  187. │Interrupt 10h  Video Services                                  3**2  │
  188. └─────────────────────────────────────────────────────────────────────┘
  189. (0:0040h)       The BIOS Video Services may be found in Chapter 16.
  190.  
  191. (internal) Coprocessor Error (80286+)
  192.         Generated by the CPU when the -ERROR pin is asserted by the 
  193.         coprocessor (usually 80x87, but may be any multimaster CPU or
  194.         alternate NDP such as Weitek, etc.).  ATs and clones usually
  195.         wire the coprocessor to use IRQ13, but not all get it right. 
  196.  
  197.  
  198. ┌─────────────────────────────────────────────────────────────────────┐
  199. │Interrupt 11h  Equipment Check                                 3**3  │
  200. └─────────────────────────────────────────────────────────────────────┘
  201. (0:0044h)       Reads the BIOS Data Area and returns two bytes of setup
  202.                 information.
  203. entry   no parameters are required
  204. return  AX      Equipment listing word. Bits are:
  205.                 0       number of floppy drives
  206.                         0       no drives
  207.                         1       bootable (IPL) diskette drive installed
  208.                 1       math chip
  209.                         0       no math coprocessor (80x87) present
  210.                         1       math coprocessor (80x87) present
  211.          (PS/2) 2       0       mouse not installed
  212.                         1       mouse installed
  213.           (PC)  2,3     system board RAM
  214.                         0,0     16k    (PC-0, PC-1)
  215.                         0,1     32k
  216.                         1,0     48k
  217.                         1,1     64k    (PC-2, XT)
  218.                         note 1) not commonly used. Set both bits to 1
  219.                              2) both bits always 1 in AT
  220.                 4,5     initial video mode
  221.                         0,0     no video installed
  222.                                 (use with dumb terminal)
  223.                         0,1     40x25 color      (CGA)
  224.                         1,0     80x25 color
  225.                                 (CGA, EGA, PGA, MCGA, VGA)
  226.                         1,1     80x25 monochrome (MDA or Hercules,
  227.                                 most super-hires mono systems)
  228.                 6,7     number of diskette drives (only if bit 0 is 1)
  229.                         0,0     1 drives
  230.                         0,1     2 drives
  231.                         1,0     3 drives
  232.                         1,1     4 drives
  233.                 8       0       DMA present
  234.                         1       no DMA (PCjr, some Tandy 1000s, 1400LT)
  235.                 9,A,B   number of RS232 serial ports (0-3)
  236.                         0,0,0   none
  237.                         0,0,1   1
  238.                         0,1,0   2
  239.                         0,1,1   3
  240.                         1,0,0   4
  241.                 C       0       no game I/O attached
  242.                         1       game I/O attached (default for PCjr)
  243.                 D       serial accessory installation
  244.                         0       no serial accessories installed
  245.                         1       Convertible - internal modem installed
  246.                                 or PCjr - serial printer attached
  247.                 E,F     number of parallel printers
  248.                         0,0     none
  249.                         0,1     one   (LPT1, PRN)
  250.                         1,0     two   (LPT2)
  251.                         1,1     three (LPT3)
  252.                         note    Models before PS/2 would allow a fourth
  253.                                 parallel printer.  Remapping of the
  254.                                 BIOS in the PS/2s does not allow the
  255.                                 use of LPT4.
  256.         (386 extended AX)
  257.                 23d     0       Weitek ABACUS - virtual '86 EMS page
  258.                                 tables not correctly initialized
  259.                         1       Weitek ABACUS - virtual '86 EMS page
  260.                                 tables OK
  261.  
  262.                 24d     0       Weitek ABACUS NDP not present
  263.                         1       Weitek ABACUS NDP present
  264.  
  265. note    Not all BIOSes properly return the presence of a game port.
  266.         In my experience, most BIOSes require a joystick to actually
  267.         be present even if the port is otherwise enabled.
  268.  
  269.  
  270.  
  271. ┌─────────────────────────────────────────────────────────────────────┐
  272. │Interrupt 12h  Memory Size                                     3**4  │
  273. └─────────────────────────────────────────────────────────────────────┘
  274. (0:0048h)       get amount of system memory
  275. entry   no parameters required
  276. return  AX      number of contiguous 1K RAM blocks available for DOS
  277. note 1) This is the same value stored in absolute address 04:13h.
  278.      2) For some early PC models, the amount of memory returned by this
  279.         call is determined by the settings of the DIP switches on the
  280.         motherboard and may not reflect all the memory that is
  281.         physically present.
  282.      3) For the PC/AT, the value returned is the amount of functional
  283.         memory found during the power-on self-test, regardless of the
  284.         memory size configuration information stored in CMOS RAM.
  285.      4) The value returned does not reflect any extended memory (above
  286.         the 1 Mb boundary) that may be present on machines using 80286
  287.         or later microprocessors.
  288.  
  289.  
  290.  
  291. ┌─────────────────────────────────────────────────────────────────────┐
  292. │Interrupt 13h  Disk Functions                                  3**5  │
  293. └─────────────────────────────────────────────────────────────────────┘
  294. (0:0049h)       The service calls for BIOS disk functions are located
  295.                 in Chapter 8.
  296.  
  297.  
  298.  
  299.  
  300. ┌─────────────────────────────────────────────────────────────────────┐
  301. │Interrupt 14h  Initialize and Access Serial Port For Int 14    3**6  │
  302. └─────────────────────────────────────────────────────────────────────┘
  303. Note 1) Some IBM PS/2 Model 50Z machines were delivered with serial
  304.         ports that did not meet specification.  Some cheap clone serial
  305.         ports may also be troublesome.
  306.      2) The standard IBM serial routines are unbuffered and not
  307.         interrupt driven.  They are fairly useless for anything other
  308.         than serial printers.  Most application software either
  309.         programs the UARTs directly or use a driver with a high-level
  310.         interface such as a FOSSIL.
  311.      3) PC-MOS/386' $SERIAL.SYS driver is buffered, device-independent,
  312.         and interrupt-driven.  It supports COM1 through COM24.
  313.  
  314. (0:0050h)       the following status is defined:
  315.  
  316.         serial status byte:
  317.         bits    0 delta clear to send
  318.                 1 delta data set ready
  319.                 2 trailing edge ring detector
  320.                 3 delta receive line signal detect
  321.                 4 clear to send
  322.                 5 data set ready
  323.                 6 ring indicator
  324.                 7 receive line signal detect
  325.  
  326.         line status byte:
  327.         bits    0 data ready
  328.                 1 overrun error
  329.                 2 parity error
  330.                 3 framing error
  331.                 4 break detect
  332.                 5 transmit holding register empty
  333.                 6 transmit shift register empty
  334.                 7 time out
  335.  
  336.    note: if bit 7 set then other bits are invalid
  337.  
  338.         Though present on the IBM PS/2s, COM3 and COM4 are not widely
  339.         standardized across the industry. The most common definitions
  340.         are:
  341.  
  342.         port    addr.   IRQ     interrupt
  343.  
  344.         COM1    3F8     IRQ4    int 0Ch
  345.         COM2    2F8     IRQ3    int 0Bh
  346.         COM3    3E8     IRQ4    int 0Ch
  347.         COM4    2E8     IRQ3    int 0Bh
  348.  
  349.         As you can see, COM1/COM3 and COM2/COM4 are siamesed.  Since
  350.         the ISA bus does not support shared interrupts, simultaneous
  351.         access of two of a pair may cause conflict.  For example, a
  352.         mouse and a modem would not coexist well on paired ports.
  353.  
  354.  
  355.  All routines have AH=function number and DX=RS232 card number (0 
  356. based). AL=character to send or received character on exit, unless 
  357. otherwise noted. 
  358.  
  359. entry   AH      00h     Initialize and Access Serial Port
  360.                         bit pattern: BBBPPSLL
  361.                         BBB = baud rate:   110, 150, 300, 600, 1200,
  362.                                            2400, 4800, 9600
  363.                         PP  = parity:      01 = odd, 11 = even
  364.                         S   = stop bits:   0 = 1, 1 = 2
  365.                         LL  = word length: 10 = 7-bits, 11 = 8-bits
  366.         AL      parms for initialization:
  367.                 bit pattern:
  368.                 0       word length
  369.                 1       word length
  370.                 2       stop bits
  371.                 3       parity
  372.                 4       parity
  373.                 5       baud rate
  374.                 6       baud rate
  375.                 7       baud rate
  376.                 word length     10      7 bits
  377.                                 11      8 bits
  378.                 stop bits       0       1 stop bit
  379.                                 1       2 stop bits
  380.                 parity          00      none
  381.                                 01      odd
  382.                                 11      even
  383.                 baud rate       000     110 baud
  384.                                 001     150 baud
  385.                                 010     300 baud
  386.                                 011     600 baud
  387.                                 100     1200 baud
  388.                                 101     2400 baud
  389.                                 110     4800 baud
  390.                                 111     9600 baud  (4800 on PCjr)
  391.         DX      port number (0=COM1, 1=COM2, etc.)
  392. return  AH      line status
  393.         AL      modem status
  394. note    To initialize the serial port to more than 9600 baud on PS/2
  395.         machines, see functions 04h and 05h.
  396.  
  397.  
  398. Function 01h    Send Character in AL to Comm Port
  399. entry   AH      01h
  400.         AL      character
  401.         DX      port number (0 - 3)
  402. return  AH      RS232 status code
  403.                 bit     0       data ready
  404.                         1       overrun error
  405.                         2       parity error
  406.                         3       framing error
  407.                         4       break detected
  408.                         5       transmission buffer register empty
  409.                         6       transmission shift register empty
  410.                         7       timeout
  411.         AL      modem status
  412.                 bit
  413.                         0       delta clear-to-send
  414.                         1       delta data-set-ready
  415.                         2       trailing edge ring detected
  416.                         3       change, receive line signal detected
  417.                         4       clear-to-send
  418.                         5       data-set-ready
  419.                         6       ring received
  420.                         7       receive line signal detected
  421.  
  422.  
  423. Function 02h    Wait For A Character From Comm Port DX
  424. entry   AH      02h
  425.         DX      port number (0-3)
  426. return  AL      character received
  427.         AH      error code (see above)(00h for no error)
  428.  
  429.  
  430. Function 03h    Fetch the Status of Comm Port DX (0 or 1)
  431. entry   AH      03h
  432.         DX      port (0-3)
  433. return  AH      set bits (01h) indicate comm-line status
  434.                 bit     7       timeout
  435.                 bit     6       empty transmit shift register
  436.                 bit     5       empty transmit holding register
  437.                 bit     4       break detected ("long-space")
  438.                 bit     3       framing error
  439.                 bit     2       parity error
  440.                 bit     1       overrun error
  441.                 bit     0       data ready
  442.         AL      set bits indicate modem status
  443.                 bit     7       received line signal detect
  444.                 bit     6       ring indicator
  445.                 bit     5       data set ready
  446.                 bit     4       clear to send
  447.                 bit     3       delta receive line signal detect
  448.                 bit     2       trailing edge ring detector
  449.                 bit     1       delta data set ready
  450.                 bit     0       delta clear to send
  451.  
  452.  
  453. Function 04h    Extended Initialize
  454.                 (Convertible, PS/2)
  455. entry   AH      04h
  456.         AL      break status
  457.                 01h     if break
  458.                 00h     if no break
  459.         BH      parity
  460.                 00h     no parity
  461.                 01h     odd parity
  462.                 02h     even parity
  463.                 03h     stick parity odd
  464.                 04h     stick parity even
  465.         BL      number of stop bits
  466.                 00h     one stop bit
  467.                 01h     2 stop bits (1½ if 5 bit word length)
  468.         CH      word length
  469.                 00h     5 bits
  470.                 01h     6 bits
  471.                 02h     7 bits
  472.                 03h     8 bits
  473.         CL      baud rate
  474.                 00h     110
  475.                 01h     150
  476.                 02h     300
  477.                 03h     600
  478.                 04h     1200
  479.                 05h     2400
  480.                 06h     4800
  481.                 07h     9600
  482.                 08h     19200
  483.         DX      comm port (0-3)
  484. return  AH      line control status
  485.         AL      modem status
  486. note    Provides a superset of fn 00h capabilities for PS/2 machines.
  487.  
  488.  
  489. Function 05h    Extended Communication Port Control
  490.                 (Convertible, PS/2)
  491. entry   AH      05h
  492.         AL      00h     read modem control register
  493.                 01h     write modem control register
  494.         BL      modem control register
  495.            bits 0       DTR data terminal ready
  496.                 1       RTS request to send
  497.                 2       out1
  498.                 3       out2
  499.                 4       loop
  500.                 5,6,7   reserved
  501.         DX      port number (0=COM1, 1=COM2, etc.)
  502. return  AH      port status (see 00h above)
  503.         AL      modem status (see 00h above)
  504.         BL      modem control register (see 01h above)
  505.  
  506.  
  507. Function 80-97h PC-MOS/386 Serial Device Interface
  508.         (see PCMOS xhapter) 
  509.  
  510.  
  511.  
  512.  
  513. FOSSIL Drivers .................................................. 3**7
  514.  
  515. Interrupt  14h  FOSSIL (Fido/Opus/Seadog Standard Interface Level)
  516.  
  517.                 A FOSSIL is a device driver for handling the IBM PC
  518.                 serial communications ports in a standard fashion from
  519.                 an application (communications) program.  A FOSSIL
  520.                 chains into the int 14h BIOS communications vector and
  521.                 replaces many functions with enhanced routines which
  522.                 may be easily accessed by an application.
  523.  
  524.                 For all functions, all registers not specifically 
  525.                 containing a function return value must be preserved
  526.                 across the call.
  527.  
  528.  
  529. entry   AH      00h     FOSSIL: Set Baud Rate And Parameters
  530.         AL      byte
  531.                 bits 7,6,5 baudrate
  532.                 000     19200 baud
  533.                 001     38400 baud
  534.                 010     300 baud
  535.                 011     600 baud
  536.                 100     1200 baud
  537.                 101     2400 baud
  538.                 110     4800 baud
  539.                 111     9600 baud
  540.                 bits 4,3 parity
  541.                 00      none
  542.                 01      odd
  543.                 10      none
  544.                 11      even
  545.                 bit 2 stop bits
  546.                 0       1 stop bit
  547.                 1       2 stop bits
  548.                 bit 1 char length
  549.                 0       5 bits plus value
  550.                 other   optional
  551.         DX      port number (NOP if DX=00FFh)
  552. return  AX      status (see fn 03h)
  553. note    Low-order 5 bits are undefined by FOSSIL 1.0 spec.
  554.  
  555.  
  556. entry   AH      01h     FOSSIL: Transmit Character With Wait
  557.         AL      ASCII value of character to be sent
  558.         DX      port number (NOP if DX=00FFh)
  559. return  AX      status bits (see function 03h)
  560. note    Character is queued for transmission.  If there is room in the
  561.         transmitter buffer when this call is made, the character will
  562.         be stored and control returned to caller.  If the buffer is
  563.         full, the driver will wait for room.  Use this function with
  564.         caution when flow control is enabled.
  565.  
  566.  
  567. entry   AH      02h     FOSSIL: Receive A Character With Wait
  568.         DX      port number (0-3) (NOP if DX=00FFh)
  569. return  AH      RS-232 status code (see AH=00h above)
  570.         AL      ASCII value of character received from serial port
  571. note    Will timeout if DSR is not asserted, even if function 03h
  572.         returns data ready.
  573.  
  574.  
  575. entry   AH      03h     FOSSIL: Request Status
  576.         DX      port number  (NOP if DX=00FFh)
  577. return  AX      status bit mask
  578.                 AH      bit 0 set  RDA     input data is available
  579.                                            in buffer
  580.                             1 set  OVRN    input buffer overrun
  581.                             2 N/A
  582.                             3 N/A
  583.                             4 N/A
  584.                             5 set  THRE    room is available in output
  585.                                            buffer
  586.                             6 set  TSRE    output buffer is empty
  587.                             7 N/A
  588.                 AL      bit 0 N/A
  589.                             1 N/A
  590.                             2 N/A
  591.                             3 set          this bit is always set
  592.                             4 N/A
  593.                             5 N/A
  594.                             6 N/A
  595.                             7 set  DCD     carrier detect
  596. note    Bit 3 of AL is always returned set to enable programs to use 
  597.         it as a carrier detect bit on hardwired (null modem) links. 
  598.  
  599.  
  600. entry   AH      04h     FOSSIL: Initialize FOSSIL Driver
  601.         BX      4F50h                      (optional)
  602.         DX      port number                (DX=00FFh special)
  603.         ES:CX   pointer to ^C flag address (optional)
  604. return  AX      1954h if successful
  605.         BL      maximum function number supported (excluding 7Eh-0BFh)
  606.         BH      revision of FOSSIL supported
  607. note 1) DTR is raised when FOSSIL inits.
  608.      2) Existing baudrate is preserved.
  609.      3) If BX contains 4F50h, the address specified in ES:CX is that 
  610.         of a ^C flag byte in the application program, to be
  611.         incremented when ^C is detected in the keyboard service
  612.         routines.  This is an optional service and only need be
  613.         supported on machines where the keyboard service can't (or
  614.         won't) perform an int 1Bh or int 23h when a control-C is 
  615.         entered. 
  616.  
  617.  
  618. entry   AH      05h     FOSSIL: Deinitialize FOSSIL Driver
  619.         DX      port number  (DX=00FFh special)
  620. return  none
  621. note 1) DTR is not affected.
  622.      2) Disengages driver from comm port.  Should be done when
  623.         operations on the port are complete.
  624.      3) If DX=00FFh, the initialization that was performed when
  625.         FOSSIL function 04h with DX=00FFh should be undone.
  626.  
  627.  
  628. entry   AH      06h     FOSSIL: Raise/Lower DTR 
  629.         AL      DTR state to be set
  630.                 00h     lower DTR
  631.                 01h     raise DTR
  632.         DX      comm port (NOP if DX=00FFh)
  633. return  none
  634.  
  635.  
  636. entry   AH      07h     FOSSIL: Return Timer Tick Parameters
  637. return  AH      ticks per second on interrupt number shown in AL
  638.         AL      timer tick interrupt number (not vector!)
  639.         DX      milliseconds per tick (approximate)
  640.  
  641.  
  642. entry   AH      08h     FOSSIL: Flush Output Buffer
  643.         DX      port number (NOP if DX=00FFh)
  644. return  none
  645. note    Waits until all output is done.
  646.  
  647.  
  648. entry   AH      09h     FOSSIL: Purge Output Buffer
  649.         DX      port number (NOP if DX=00FFh)
  650. return  none
  651. note    Returns to caller immediately.
  652.  
  653.  
  654. entry   AH      0Ah     FOSSIL: Purge input buffer
  655.         DX      port number (NOP if DX=00FFh)
  656. return  none
  657. note 1) If any flow control restraint has been employed (dropping
  658.         RTS or transmitting XOFF) the port will be "released" by
  659.         doing the reverse, raising RTS or sending XON.
  660.      2) Returns to caller immediately.
  661.  
  662.  
  663. entry   AH      0Bh     FOSSIL: Transmit No Wait
  664.         AL      ASCII character value to be sent
  665.         DX      port number (NOP if DX=00FFh)
  666. return  AX      0000h   character not accepted
  667.                 0001h   character accepted
  668. note    This is exactly the same as the "regular" transmit call
  669.         except that if there is no space available in the output
  670.         buffer a value of zero is returned in AX, if room is
  671.         available a value 1 (one) is returned.
  672.  
  673.  
  674. entry   AH      0Ch     FOSSIL: Nondestructive Read No Wait
  675.         DX      port number (NOP if DX=00FFh)
  676. return  AH      character
  677.                 0FFFFh  character not available
  678. note 1) Reads async buffer.
  679.      2) Does not remove keycode from buffer.
  680.  
  681.  
  682. entry   AH      0Dh     FOSSIL: Keyboard Read No Wait
  683. return  AX      IBM keyboard scan code or
  684.                 0FFFFh if no keyboard character available
  685. note 1) Use IBM-style function key mapping in the high order byte.
  686.      2) Scan codes for non function keys are not specifically
  687.         required but may be included.
  688.      3) Does not remove keycode from buffer.
  689.  
  690.  
  691. entry   AH      0Eh     FOSSIL: Keyboard Input With Wait
  692. return  AX      IBM keyboard scan code
  693. note    Returns the next character from the keyboard or waits if
  694.         no character is available.
  695.  
  696.  
  697. entry   AH      0Fh     FOSSIL: Toggle Flow Control
  698.         AL      bit mask describing requested flow control
  699.            bits 0       XON/XOFF on transmit (watch for XOFF while
  700.                         sending)
  701.                 1       CTS/RTS (CTS on transmit/RTS on receive)
  702.                 2       reserved
  703.                 3       XON/XOFF on receive (send XOFF when buffer
  704.                         near full)
  705.                 4-7     not used, FOSSIL spec calls for setting to 1
  706.         DX      port number (NOP if DX=00FFh)
  707. return  none
  708. note 1) Bit 2 is reserved for DSR/DTR,  but is not currently
  709.         supported in any implementation.
  710.      2) TRANSMIT flow control allows the other end to restrain the
  711.         transmitter when you are overrunning it.  RECEIVE flow control
  712.         tells the FOSSIL to attempt to do just that if it is being
  713.         overwhelmed.
  714.      3) Enabling transmit XON/XOFf will cause the FOSSIL to stop
  715.         transmitting upon receiving an XOFf. The FOSSIL will resume
  716.         transmitting when an XON is received.
  717.      4) Enabling CTS/RTS will cause the FOSSIL to cease transmitting
  718.         when CTS is lowered.  Transmission will resume when CTS is
  719.         raised.  The FOSSIL will drop RTS when the receive buffer
  720.         reaches a predetermined percentage full.  The FOSSIL will
  721.         raise RTS when the receive buffer empties below the
  722.         predetermined percentage full.  The point(s) at which this
  723.         occurs is left to the individual FOSSIL implementor.
  724.      5) Enabling receive Xon/Xoff will cause the FOSSIL to send an XOFF
  725.         when the receive buffer reaches a pre-determined percentage
  726.         full.  An XON will be sent when the receive buffer empties
  727.         below the predetermined percentage full.  The point(s) at which
  728.         this occurs is left to the individual FOSSIL implementor.
  729.      6) Applications using this function should set all bits ON in the
  730.         high nibble of AL as well.  There is a compatible (but not
  731.         identical) FOSSIL driver implementation that uses the high
  732.         nibble as a control mask.  If your application sets the high
  733.         nibble to all ones, it will always work, regardless of the
  734.         method used by any given driver.
  735.  
  736.  
  737. entry   AH      10h     Extended Ctrl-C/Ctrl-K Checking
  738.                         And Transmit On/Off
  739.         AL      flags bit mask byte (bit set if activated)
  740.            bits 0       enable/disable Ctrl-C/Ctrl-K checking
  741.                 1       disable/enable the transmitter
  742.                 2-7     not used
  743.         DX      port number (NOP if DX=00FFh)
  744. return  AX      status byte
  745.                 0000h   control-C/K has not been received
  746.                 0001h   control-C/K has been received
  747. note    This is used primarily for programs that can't trust XON/XOFF
  748.         at FOSSIL level (such as BBS software).
  749.  
  750.  
  751. entry   AH      11h     FOSSIL: Set Current Cursor Location
  752.         DH      row (line) 0-24
  753.         DL      column     0-79
  754. return  none
  755. note 1) This function looks exactly like the int 10h, fn 02h on the
  756.         IBM PC.  The cursor location is passed in DX: row in DH and
  757.         column in DL.  This function treats the screen as a coordinate
  758.         system whose origin (0,0) is the upper left hand corner of the
  759.         screen.
  760.      2) Row and column start at 0.
  761.  
  762.  
  763. entry   AH      12h     FOSSIL: Read Current Cursor Location
  764. return  DH      row (line)
  765.         DL      column
  766. note 1) Looks exactly like int 10h/fn 03h in the IBM PC BIOS.  The
  767.         current cursor location (same coordinate system as function
  768.         16h) is passed back in DX.
  769.      2) Row and column start at 0.
  770.  
  771.  
  772. entry   AH      13h     FOSSIL: Single Character ANSI Write To Screen
  773.         AL      value of character to display
  774. return  none
  775. note    This call might not be reentrant since ANSI processing may be
  776.         through DOS.
  777.  
  778.  
  779. entry   AH      14h     FOSSIL: Toggle Watchdog Processing
  780.         AL      00h     to disable watchdog
  781.                 01h     to enable watchdog
  782.         DX      port number (NOP if DX=00FFh)
  783. return  none
  784. note 1) This call will cause the FOSSIL to reboot the system if Carrier
  785.         Detect for the specified port drops while watchdog is turned
  786.         on.
  787.      2) The port need not be active for this function to work.
  788.  
  789.  
  790. entry   AH      15h     FOSSIL: Write Character To Screen Using BIOS
  791.         AL      ASCII code of character to display
  792. return  none
  793. note 1) This function is reentrant.
  794.      2) ANSI processing may not be assumed.
  795.  
  796.  
  797. entry   AH      16h     FOSSIL: Insert or Delete a Function From The
  798.                         Timer Tick Chain
  799.         AL      00h     to delete a function
  800.                 01h     to add a function
  801.         ES:DX   address of function
  802. return  AX      0000h   successful
  803.                 0FFFFh  unsuccessful
  804.  
  805.  
  806. entry   AH      17h     FOSSIL: Reboot System
  807.         AL      boot type
  808.                 00h     cold boot
  809.                 01h     warm boot
  810. return  none
  811.  
  812.  
  813. entry   AH      18h     FOSSIL: Read Block
  814.         CX      maximum number of characters to transfer
  815.         DX      port number (NOP if DX=00FFh)
  816.         ES:DI   pointer to user buffer
  817. return  AX      number of characters transferred
  818. note 1) This function does not wait for more characters to become
  819.         available if the value in CX exceeds the number of characters
  820.         currently stored.
  821.      2) ES:DI are left unchanged by the call; the count of bytes
  822.         actually transferred will be returned in AX.
  823.  
  824.  
  825. entry   AH      19h     FOSSIL: Write Block
  826.         CX      maximum number of characters to transfer
  827.         DX      port number  (NOP if DX=00FFh)
  828.         ES:DI   pointer to user buffer
  829. return  AX      number of characters transfered
  830. note    ES and DI are not modified by this call.
  831.  
  832.  
  833. entry   AH      1Ah     FOSSIL: BREAK Signal Begin Or End
  834.         AL      00h     stop sending 'break'
  835.                 01h     start sending 'break'
  836.         DX      port number  (NOP if DX=00FFh)
  837. return  none
  838. note 1) Resets all transmit flow control restraints such as an XOFF
  839.         received from remote.
  840.      2) Init (fn 04h) or UnInit (fn 05h) will stop an in-progress
  841.         break.
  842.      3) The application must determine the "length" of the break.
  843.  
  844.  
  845. entry   AH      1Bh     FOSSIL: Return Driver Information
  846.         CX      size of user buffer in bytes
  847.         DX      port number  (if DX=00FFh, port data will not be valid)
  848.         ES:DI   pointer to user buffer
  849. return  AX      number of characters transferred
  850.         ES:DI   user buffer structure:
  851.                 00h     word    size of structure in bytes
  852.                 02h     byte    FOSSIL driver version
  853.                 03h     byte    revision level of this specific driver
  854.                 04h     dword   FAR pointer to ASCII ID string
  855.                 08h     word    size of the input buffer in bytes
  856.                 0Ah     word    number of bytes in input buffer
  857.                 0Ch     word    size of the output buffer in bytes
  858.                 0Eh     word    number of bytes in output buffer
  859.                 10h     byte    width of screen in characters
  860.                 11h     byte    screen height in characters
  861.                 12h     byte    actual baud rate, computer to modem
  862.                                 (see mask in function 00h
  863. note 1) The baud rate byte contains the bits that fn 00h would use to
  864.         set the port to that speed.
  865.      2) The fields related to a particular port (buffer size, space
  866.         left in the buffer, baud rate) will be undefined if port=0FFh
  867.         or an invalid port is contained in DX.
  868.      3) Additional information will always be passed after these, so
  869.         that the fields will never change with FOSSIL revision changes.
  870.  
  871.  
  872. entry   AH      7Eh     FOSSIL: Install An External Application Function
  873.         AL      code assigned to external application
  874.         ES:DX   pointer to entry point
  875. return  AX      1954h   FOSSIL driver present
  876.             not 1954h   FOSSIL driver not present
  877.         BH      00h     failed
  878.                 01h     successful
  879.         BL      code assigned to application (same as input AL)
  880. note 1) Application codes 80h-0BFh are supported.  Codes 80h-83h are
  881.         reserved.
  882.      2) An error code of BH=00h with AX=1954h should mean that another
  883.         external application has already been installed with the code
  884.         specified in AL.
  885.      3) Applications are entered via a FAR call and should make a FAR
  886.         return.
  887.  
  888.  
  889. entry   AH      7Fh     FOSSIL: Remove An External Application Function
  890.         AL      code assigned to external application
  891.         ES:DX   pointer to entry point
  892. return  AX      1954h
  893.         BH      00h     failed
  894.                 01h     successful
  895.         BL      code assigned to application (same as input AL)
  896.  
  897.  
  898.  
  899. ┌─────────────────────────────────────────────────────────────────────┐
  900. │Interrupt 15h  Cassette I/O                                    3**8  │
  901. └─────────────────────────────────────────────────────────────────────┘
  902. (0:0054h)    1) Renamed "System Services" on PS/2 line.
  903.              2) Issuing int 15h on an XT may cause a system crash.
  904.                 On AT and after, interrupts are disabled with CLI when
  905.                 the interrupt service routine is called, but most ROM
  906.                 versions do not restore interrupts with STI.
  907.              3) For the original IBM PC, int 15h returns AH=80h and CF
  908.                 set for all calls with AH not 0,1, or 2.
  909.              4) For the PC/XT int 15h returns AH=86h, CF set if called
  910.                 at all.  (the PC/XT ROM BIOS does not support int 15h)
  911.              5) For the AT/339, int 15h returns AH=86h, CF set if
  912.                 called with an invalid function code.
  913.  
  914.  
  915. Function 00h    Turn Cassette Motor On
  916.                 (PC, PCjr only)
  917. entry   AH      00h
  918. return  CF      set on error
  919.                 AH      error code
  920.                         00h     no errors
  921.                         01h     CRC error
  922.                         02h     bad tape signals
  923.                                 no data transitions (PCjr)
  924.                         03h     no data found on tape
  925.                                 not used (PCjr)
  926.                         04h     no data
  927.                                 no leader (PCjr)
  928.                         80h     invalid command
  929.                         86h     no cassette present
  930.                                 not valid in PCjr
  931. note    NOP for systems where cassette not supported.
  932.  
  933.  
  934. Function 01h    Turn Cassette Motor Off
  935.                 (PC, PCjr only)
  936. entry   AH      01h
  937. return  CF      set on error
  938.         AH      error code (86h)
  939. note    NOP for systems where cassette not supported.
  940.  
  941.  
  942. Function 02h    Read Blocks From Cassette
  943.                 (PC, PCjr only)
  944. entry   AH      02h
  945.         CX      number of bytes to read
  946.         ES:BX   segment:offset + 1 of last byte read
  947. return  CF      set on error
  948.                 AH      error code (01h, 02h, 04h, 80h, 86h)
  949.         DX      count of bytes actually read
  950.         ES:BX   pointer past last byte written
  951. note 1) NOP for systems where cassette not supported.
  952.      2) Cassette operations normally read 256 byte blocks.
  953.  
  954.  
  955. Function 03h    Write Data Blocks to Cassette
  956.                 (PC, PCjr only)
  957. entry   AH      03h
  958.         CX      count of bytes to write
  959.         ES:BX   pointer to data buffer
  960. return  CF      set on error
  961.                 AH      error code (80h, 86h)
  962.         CX      00h
  963.         ES:BX   pointer to last byte written+1
  964. note 1) NOP for systems where cassette not supported.
  965.      2) The last block is padded to 256 bytes with zeroes if needed.
  966.      3) No errors are returned by this service.
  967.  
  968.  
  969. Function 0Fh    ESDI Format Unit Periodic Interrupt
  970.                 (PS/2 50+)
  971. entry   AH      0Fh
  972.         AL      phase code
  973.                 00h     reserved
  974.                 01h     surface analysis
  975.                 02h     formatting
  976. return  CF      clear   if formatting should continue
  977.                 set     if it should terminate
  978. note 1) Called the BIOS on the ESDI Fixed Disk Drive Adapter/A during
  979.         a format or surface analysis operation after each cylinder is
  980.         completed.
  981.      2) This function call can be captured by a program so that it
  982.         will be notified as each cylinder is formatted or analyzed.
  983.         The program can count interrupts for each phase to determine
  984.         the current cylinder number.
  985.      3) The BIOS default handler for this function returns with CF set. 
  986.  
  987.  
  988. Function 10h    TopView API Function Calls                (TopView)
  989.                 see Chapter 17
  990.  
  991.  
  992. Function 20h    PRINT.COM  (DOS 3.1+ internal)
  993.                 (AT, XT/286, PS/2 50+)
  994. entry   AH      20h
  995.         AL      subfunction
  996.                 00h     disable critical region flag
  997.                 01h     set critical region flag
  998.                         ES:BX   pointer to flag byte set while inside
  999.                                 DOS calls
  1000.                 10h     set up SysReq routine
  1001.                 11h     completion of SysReq routine (software only)
  1002.  
  1003.  
  1004. Function 21h    Read Power-On Self Test (POST) Error Log
  1005.                 (PS/2 50+)
  1006. entry   AH      21h
  1007.         AL      00h     read POST log
  1008.                 01h     write POST log
  1009.                         BH      device ID
  1010.                         BL      device error code
  1011. return  CF      set on error
  1012.         AH      status
  1013.                 00h     successful read
  1014.                         BX      number of POST error codes stored
  1015.                         ES:DI   pointer to error log
  1016.                 01h     list full
  1017.                 80h     invalid command
  1018.                 86h     function unsupported
  1019. note    The log is a series of words, the first byte of which
  1020.         identifies the error code and the second is the device ID.
  1021.  
  1022.  
  1023. Function 40h    Read/Modify Profiles
  1024.                 (Convertible)
  1025. entry   AH      40h
  1026.         AL      00h     read system profile in CX,BX
  1027.                 01h     write system profile from CX, BX
  1028.                 02h     read internal modem profile in BX
  1029.                 03h     write internal modem profile from BX
  1030.         BX      profile info
  1031. return  BX      internal modem profile (from 02h)
  1032.         CX,BX   system profile (from 00h)
  1033.  
  1034.  
  1035. Function 41h    Wait On External Event
  1036.                 (Convertible)
  1037. entry   AH      41h
  1038.         AL      condition type
  1039.            bits 0-2     condition to wait for
  1040.                         0,0,0   any external event
  1041.                         0,0,1   compare and return if equal
  1042.                         0,1,0   compare and return if not equal
  1043.                         0,1,1   test and return if not zero
  1044.                         1,0,0   test and return if zero
  1045.                 3       reserved
  1046.                 4       0       user byte
  1047.                         1       port address
  1048.                 5-7     reserved
  1049.         BH      condition compare or mask value
  1050.                 condition codes:
  1051.                 00h     any external event
  1052.                 01h     compare and return if equal
  1053.                 02h     compare and return if not equal
  1054.                 03h     test and return if not zero
  1055.                 04h     test and return if zero
  1056.         BL      timeout value times 55 milliseconds
  1057.                 00h     if no time limit
  1058.         DX      I/O port address (if AL bit 4=1)
  1059.         ES:DI   pointer to user byte (if AL bit 4=0)
  1060.  
  1061.  
  1062. Function 42h    Request System Power Off
  1063.                 (Convertible)
  1064. entry   AH      42h
  1065.         AL      00h     to use system profile
  1066.                 01h     to force suspend regardless of profile
  1067. return  unknown
  1068. note    With early versions of DOS 5.0, the IBM L40SX would not
  1069.         Suspend/Resume if DOS=LOW was in CONFIG.SYS.
  1070.  
  1071.  
  1072. Function 43h    Read System Status
  1073.                 (Convertible)
  1074. entry   AH      43h
  1075. return  AL      status byte
  1076.             bit 0       LCD detached
  1077.                 1       reserved
  1078.                 2       RS232/parallel powered on
  1079.                 3       internal modem powered on
  1080.                 4       power activated by alarm
  1081.                 5       bad time
  1082.                 6       external power in use
  1083.                 7       battery low
  1084.  
  1085.  
  1086. Function 44h    Toggle Internal Modem Power
  1087.                 (Convertible)
  1088. entry   AH      44h
  1089.         AL      00h      to power off
  1090.                 01h      to power on
  1091. return  unknown
  1092.  
  1093.  
  1094. Function 4Fh    OS Hook - Keyboard Intercept
  1095.                 (except PC, PCjr, and XT)
  1096. entry   AH      4Fh
  1097.         AL      scan code, CF set
  1098. return  AL      scan code
  1099.         CF      set     processing desired
  1100.                 clear   scan code should not be used
  1101. note 1) Called by int 9 handler for each keystroke to translate scan
  1102.         codes.
  1103.      2) An OS or a TSR can capture this function to filter the raw
  1104.         keyboard data stream.  The new handler can substitute a new
  1105.         scan code, return the same scan code, or return the carry flag
  1106.         clear causing the keystroke to be discarded.  The BIOS default
  1107.         routine simply returns the scan code unchanged.
  1108.      3) A program can call int 15h/fn0C0h to determine whether the host
  1109.         machine's BIOS supports keyboard intercept.
  1110.      4) Used internally by PC-MOS/386 v4.00+ for keyboard input.
  1111.      5) Some BIOSes do not properly support this call.  Int 15h/fn 0C0h
  1112.         will tell if the BIOS is supposed to support this call.
  1113.      6) Some versions of KEYB.COM provide additional 4Fh support.
  1114.  
  1115.  
  1116. Function 70h    EEROM handler
  1117.                 (Tandy 1000HX)
  1118. entry   AH      00h     read from EEROM
  1119.                 BL      00h
  1120.                 01h     write to EEROM
  1121.                 BL      word number to write (0-15)
  1122.                 DX      word value to write
  1123. return  DX      (AH=00h) word value
  1124.         CF      set on error (system is not a Tandy 1000 HX)
  1125.  
  1126.  
  1127. Function 80h    OS Hook - Device Open
  1128.                 (AT, XT/286, PS/2)
  1129. entry   AH      80h
  1130.         BX      device ID
  1131.         CX      process ID
  1132. return  CF      set on error
  1133.         AH      status
  1134.                 00h     OK
  1135. note 1) Acquires ownership of a logical device for a process.
  1136.      2) This call, along with fns 81h and 82h, defines a simple
  1137.         protocol that can be used to arbitrate usage of devices by
  1138.         multiple processes.  A multitasking program manager would be
  1139.         expected to capture int 15h and provide the appropriate
  1140.         service.
  1141.      3) The default BIOS routine for this function simply returns with
  1142.         CF clear and AH=00h.
  1143.  
  1144.  
  1145. Function 81h    Device Close
  1146.                 (AT, XT/286, PS/2)
  1147. entry   AH      81h
  1148.         BX      device ID
  1149.         CX      process ID
  1150. return  CF      set on error
  1151.         AH      status
  1152.                 00h     OK
  1153. note 1) Releases ownership of a logical device for a process.
  1154.      2) A multitasking program manager would be expected to capture
  1155.         int 15h and provide the appropriate service.
  1156.      3) The BIOS default routine for this function simply returns with
  1157.         the CF clear and AH=00h.
  1158.  
  1159.  
  1160. Function 82h    Program Termination
  1161.                 (AT, XT/286, PS/2)
  1162.         AH      82h
  1163.         BX      device ID
  1164. return  CF      set on error
  1165.         AH      status
  1166.                 00h     OK
  1167. note 1) Closes all logical devices opened with function 80h.
  1168.      2) A multitasking program manager would be expected to capture
  1169.         int 15h and provide the appropriate service.
  1170.      3) The BIOS default routine for this function simply returns with
  1171.         CF clear and AH=00h.
  1172.  
  1173.  
  1174. Function 83h    Event Wait
  1175.                 (AT, XT/286, Convertible, PS/2 50+)
  1176. entry   AH      83h
  1177.         AL      00h     to set interval
  1178.                 01h     to cancel (CX:DX and ES:BX not required)
  1179.         CX:DX   number of microseconds to wait (granularity is 976
  1180.                                                 microseconds)
  1181.         ES:BX   pointer to semaphore flag (bit 7 is set when interval
  1182.                                            expires)
  1183.                 (pointer is to caller's memory) (some sources list bit
  1184.                                                  15 set)
  1185. return  CF      clear   OK
  1186.                 set     function already busy
  1187. note 1) Requests setting of a semaphore after a specified interval or
  1188.         cancels a previous request.
  1189.      2) The calling program is responsible for clearing the semaphore
  1190.         before requesting this function.
  1191.      3) The actual duration of an event wait is always an integral
  1192.         multiple of 976 microseconds.  The CMOS date/clock chip
  1193.         interrupts are used to implement this function.
  1194.      4) Use of this function allows programmed, hardware-independent
  1195.         delays at a finer resolution than can be obtained through use
  1196.         of the MS-DOS Get Time function (int 21h/fn 2Ch) which returns
  1197.         time in hundredths of a second.
  1198.      5) CX:DX is a four-byte integer.
  1199.      7) This function is called by int 70h and is not the normal int
  1200.         08h/1Ch clock tick.  It is generated by the MC146818A Real Time
  1201.         Clock chip.  This is the battery backed up CMOS clock chip.
  1202.  
  1203.  
  1204. Function 84h    Read Joystick Input Settings
  1205.                 (AT, XT/286, PS/2)
  1206. entry   AH      84h
  1207.         DX      00h     to read current switch settings
  1208.                         (return in AL)
  1209.                 01h     to read resistive inputs
  1210. return  CF      set on error
  1211.         (fn 00h)
  1212.         AL      switch settings (bits 7-4)
  1213.         (fn 01h)
  1214.         AX      stick A (X) value
  1215.         BX      stick A (Y) value
  1216.         CX      stick B (X) value
  1217.         DX      stick B (Y) value
  1218. note 1) An error is returned if DX does not contain a valid
  1219.         subfunction number.
  1220.      2) If no game adapter is installed, all returned values are 00h.
  1221.      3) Using a 250K Ohm joystick, the potentiometer values usually
  1222.         lie within the range 0-416 (0000h-01A0h).
  1223.      4) Not all BIOSes properly return the presence of a game port.
  1224.         In my experience, most BIOSes require a joystick to actually
  1225.         be present even if the port is otherwise enabled.
  1226.  
  1227.  
  1228. Function 85h    System Request (SysReq) Key Pressed
  1229.                 (except PC, PCjr, XT)
  1230. entry   AH      85h
  1231.         AL      00h      key pressed
  1232.                 01h      key released
  1233. return  CF      set on error
  1234.         AH      error code
  1235. note 1) Called by BIOS keyboard decode routine when the SysReq key
  1236.         is detected.
  1237.      2) The BIOS handler for this call is a dummy routine that always
  1238.         returns a success status unless called with an invalid
  1239.         subfunction number in AL.
  1240.      3) A multitasking program manager would be expected to capture
  1241.         int 15h so that it can be notified when the user strikes the
  1242.         SysReq key.
  1243.  
  1244.  
  1245. Function 86h    Wait
  1246.                 (except PC, PCjr, XT)
  1247.         AH      86h
  1248.         CX:DX   4-byte integer, number of microseconds to wait
  1249.                 CX high word, DX low word
  1250. return  CF      clear   after wait elapses
  1251.         CF      set     immediately due to error
  1252. note 1) Suspends the calling program for a specified interval in
  1253.         microseconds.
  1254.      2) The actual duration of the wait is always an integral multiple
  1255.         of 976 microseconds.
  1256.      3) Use of this function allows programmed, hardware-independent
  1257.         delays at a finer resolution than can be obtained through use
  1258.         of the MS-DOS Get Time function (int 21h fn 2Ch) which returns
  1259.         time in hundredths of a second.
  1260.      4) This function calls int 70h and is not the normal Int 08h/1Ch
  1261.         clock tick. It is generated by the MC146818A Real Time Clock
  1262.         chip.  This is the battery backed CMOS clock chip.
  1263.  
  1264.  
  1265. Function 87h    Memory Block Move
  1266.                 (2-3-486 machines only)
  1267.         AH      87h
  1268.         CX      number of words to move
  1269.         ES:SI   pointer to Global Descriptor Table (GDT)
  1270.                 offset 00h-0Fh  reserved, set to zero
  1271.                            00h  null descriptor
  1272.                            08h  uninitialized, will be made into GDT
  1273.                                 descriptor
  1274.                        10h-11h  source segment length in bytes
  1275.                                 (2*CX-1 or greater)
  1276.                        12h-14h  24-bit linear source address
  1277.                        15h      access rights byte (always 93h)
  1278.                        16h-17h  reserved, set to zero
  1279.                        18h-19h  destination segment length in bytes
  1280.                                 (2*CX-1 or greater)
  1281.                        1Ah-1Ch  24-bit linear destination address
  1282.                        1Dh      access rights byte (always 93h)
  1283.                        1Eh-1Fh  reserved, set to zero
  1284.                            20h *uninitialized, used by BIOS
  1285.                            28h *uninitialized, will be made into SS
  1286.                                 descriptor
  1287.                               (*) some sources say initialized to zero
  1288. return  CF      set on error
  1289.         AH      status
  1290.                 00h     success - source copied into destination
  1291.                 01h     RAM parity error
  1292.                 02h     exception interrupt error
  1293.                 03h     address line 20 gating failed
  1294. note 1) The GDT table is composed of six 8-byte descriptors to be
  1295.         used by the CPU in protected mode.  The four descriptors in
  1296.         offsets 00h-0Fh and 20h-2Fh are filled in by the BIOS before
  1297.         the CPU mode switch.
  1298.      2) The addresses used in the descriptor table are linear
  1299.         (physical) 24-bit addresses in the range 000000h-0FFFFFFh -
  1300.         not segments and offsets - with the least significant byte at
  1301.         the lowest address and the most significant byte at the highest
  1302.         address.
  1303.      3) Interrupts are disabled during this call; use may interfere
  1304.         with the operation of comm programs, network drivers, or other
  1305.         software that relies on prompt servicing of hardware interrupts.
  1306.      4) This call is not valid in the OS/2 Compatibility Box.
  1307.      5) This call will move a memory block from any real or protected
  1308.         mode address to any other real or protected mode address.
  1309.      6) DESQview does not intercept function 87, but QEXT and QEMM do,
  1310.         thereby allowing function 87 to work correctly inside DV.
  1311.         VDISK, which uses function 87, works inside DV.  If VDISK is
  1312.         sitting at the 1 MB mark, then the int 19h vector will have a
  1313.         VDISK signature in it.  The normal way to check for VDISK
  1314.         presence is by checking for the string "VDISK" at offset 12h
  1315.         of the segment of the int 19h vector.  If the string matches,
  1316.         then you can determine how much extended memory is reserved
  1317.         for VDISK by looking at offset 2Ch is the 3-byte address of the
  1318.         lowest extended memory address NOT in use by VDISK (i.e. if you
  1319.         see at 2Ch "00 00 14" then that means that VDISK is using
  1320.         memory up to 1 MB + 256K).
  1321.  
  1322.  
  1323. Function 88h    Get Extended Memory Size
  1324.                 (AT, XT/286, PS/2)
  1325. entry   AH      88h
  1326. return  AX      number of contiguous 1K blocks of extended memory
  1327.                 starting at address 0FFFFh (1024Kb)
  1328. note 1) This call will not work in the OS/2 Compatibility Box.
  1329.      2) Some BIOSes and software manipulate the Carry flag when this
  1330.         function is called.  When tested on a vanilla 386 with AMI BIOS
  1331.         the machine returned with the Carry Flag set.  When 386Max was
  1332.         loaded, the flag was not set.
  1333.      3) Used by IBM VDISK 4.0.
  1334.  
  1335.  
  1336. Function 89h    Switch Processor to Protected Mode
  1337.                 (AT, XT/286, PS/2)
  1338. entry   AH      89h
  1339.         BH      interrupt number for IRQ0, written to ICW2 of 8259
  1340.                 PIC #1  (must be evenly divisible by 8, determines
  1341.                 IRQ0-IRQ7)
  1342.         BL      interrupt number for IRQ8, written to ICW2 of 8259
  1343.                 PIC #2  (must be evenly divisible by 8, determines
  1344.                 IRQ8-IRQ15)
  1345.         ES:SI   pointer to 8-entry Global Descriptor Table for
  1346.                 protected mode:
  1347.                 offset  00h     null descriptor, initialized to zero
  1348.                         08h     GDT descriptor
  1349.                         10h     IDT (Interrupt Descriptor Table)
  1350.                                 descriptor
  1351.                         18h     DS, user's data segment
  1352.                         20h     ES, user's extra segment
  1353.                         28h     SS, user's stack segment
  1354.                         30h     CS, user's code segment
  1355.                         38h     uninitialized, used to build descriptor
  1356.                                 for BIOS code segment
  1357. return  CF      set on error
  1358.                 AH      0FFh  error enabling address line 20
  1359.         CF      clear   function successful (CPU is in protected mode)
  1360.                 AH      00h
  1361.                 CS      user-defined selector
  1362.                 DS      user-defined selector
  1363.                 ES      user-defined selector
  1364.                 SS      user-defined selector
  1365. note 1) The user must initialize the first seven descriptors; the
  1366.         eighth is filled in by the BIOS to provide addressability for
  1367.         its own execution.  The calling program may modify and use the
  1368.         eighth descriptor for any purpose after return from this
  1369.         function call.
  1370.      2) Intercepted by Microsoft's HIMEM.SYS and Quarterdeck's
  1371.         QEMM.SYS.
  1372.  
  1373.  
  1374. Function 90h    Device Busy Loop                  (except PC, PCjr, XT)
  1375. entry   AH      90h
  1376.         AL      predefined device type code:
  1377.                 00h     disk                              (may timeout)
  1378.                 01h     diskette                          (may timeout)
  1379.                 02h     keyboard                          (no timeout)
  1380.                 03h     PS/2 pointing device              (may timeout)
  1381.                 80h     network
  1382.                                                           (no timeout)
  1383.                 0FCh    hard disk reset (PS/2)            (may timeout)
  1384.                 0FDh    diskette motor start              (may timeout)
  1385.                 0FEh    printer                           (may timeout)
  1386.         ES:BX   pointer to request block for type codes 80h through 0FFh
  1387.                 (for network adapters, ES:BX is a pointer to network
  1388.                  control block)
  1389. return  CF      set     if wait time satisfied
  1390.                 clear   if driver must perform wait
  1391.         AH      status
  1392. note 1) Used by NETBIOS, TOPS Network, Tom Wagner's CTASK multitasker,
  1393.         Hyperdisk disk cache.
  1394.      2) Generic type codes are allocated as follows:
  1395.         00h-7Fh   non-reentrant devices; OS must arbitrate access
  1396.                   serially reusable devices
  1397.         80h-0BFh  reentrant devices; ES:BX points to a unique control
  1398.                   block
  1399.         0C0h-0FFh wait-only calls, no complementary POST int 15/fn 91h
  1400.                   call
  1401.      3) Invoked by the BIOS disk, printer, network, and keyboard
  1402.         handlers prior to performing a programmed wait for I/O
  1403.         completion.
  1404.      4) A multitasking program manager would be expected to capture
  1405.         int 15h/fn 90h so that it can dispatch other tasks while I/O
  1406.         is in progress.
  1407.      5) The default BIOS routine for this function simply returns with
  1408.         the CF clear and AH=00h.
  1409.      6) QEMM 6.0's "Stealth" mode suppresses this call.  Quarterdeck
  1410.         claims very few programs properly handle the EMS page frame
  1411.         when using this call.
  1412.  
  1413.  
  1414. Function 91h    Interrupt Completed
  1415.                 (AT, XT/286, PS/2 50+)
  1416. entry   AH      91h
  1417.         AL      type code (see AH=90h above)
  1418.                 00h-7Fh  serially reusable devices
  1419.                 80h-0BFh reentrant devices
  1420.         ES:BX   pointer to request block for type codes 80h through
  1421.                 0BFh
  1422. return  AH       00h
  1423. note 1) Used by NETBIOS and TOPS network, Tom Wagner's CTASK
  1424.         multitasker, Hyperdisk disk cache.
  1425.      2) Invoked by the BIOS disk network, and keyboard handlers to
  1426.         signal that I/O is complete and/or the device is ready.
  1427.      3) Predefined device types that may use Device POST are:
  1428.         00H  disk                   (may timeout)
  1429.         01H  floppy disk            (may timeout)
  1430.         02H  keyboard               (no timeout)
  1431.         03H  PS/2 pointing device   (may timeout)
  1432.         80H  network                (no timeout)
  1433.      4) The BIOS printer routine does not invoke this function because
  1434.         printer output is not interrupt driven.
  1435.      5) A multitasking program manager would be expected to capture
  1436.         int 15h/fn 91h so that it can be notified when I/O is
  1437.         completed and awaken the requesting task.
  1438.      6) The default BIOS routine for this function simply returns with
  1439.         the CF flag clear and AH=00h.
  1440.      7) QEMM 6.0's "Stealth" mode suppresses this call.  Quarterdeck
  1441.         claims very few programs properly handle the EMS page frame
  1442.         when using this call.
  1443.  
  1444.  
  1445. Function 0C0h   Get System Configuration
  1446.                 (XT after 1/10/86, PC Convertible, XT/286, AT, PS/2)
  1447. entry   AH      0C0h
  1448. return  CF      set     if BIOS doesn't support call
  1449.         ES:BX   pointer to ROM system descriptor table
  1450.           bytes 00h-01h number of bytes in the following table
  1451.                         (normally 16 bytes)
  1452.                 02h     system ID byte; see Chapter 2 for
  1453.                         interpretation
  1454.                 03h     secondary ID distingushes between AT and
  1455.                         XT/286, etc.
  1456.                 04h     BIOS revision level, 0 for 1st release, 1 for
  1457.                         2nd, etc.
  1458.                 05h     feature information byte
  1459.                    bits 0       reserved
  1460.                         1       Micro Channel bus (instead of ISA or
  1461.                                 EISA)
  1462.                         2       extended BIOS area allocated at 640k
  1463.                         3       wait for external event supported
  1464.                                 (int 15h/fn 41h), used on Convertible;
  1465.                                 reserved on PS/2 systems
  1466.                         4       keyboard intercept: int 15h, fn 04Fh
  1467.                                 called upon int 09h
  1468.                         5       realtime clock installed
  1469.                         6       second 8259 installed (cascaded IRQ2)
  1470.                         7       DMA channel 3 - used by hard disk
  1471.                                 BIOS
  1472.                 06h     unknown (set to 0) (reserved by IBM)
  1473.                 07h     unknown (set to 0) (reserved by IBM)
  1474.                 08h     unknown (set to 0)
  1475.                 09h     unknown (set to 0) (Award BIOS copyright here)
  1476. note 1) Int 15h is also used for the Multitask Hook on PS/2 machines.
  1477.         No register settings available yet.
  1478.      2) The 1/10/86 XT BIOS returns an incorrect value for the
  1479.         feature byte.
  1480.      3) Novell documents some versions of Netware prior to 2.2 as
  1481.         having problems on PS/2 machines due to a bug which did not
  1482.         return from the interrupt correctly.
  1483.      4) Some AMI BIOSes do not support this function, such as the 
  1484.         ones in early Dell machines.
  1485.  
  1486.  
  1487. Function 0C1h   Return Extended BIOS Data Area Segment Address
  1488.                 (AT & later)
  1489. entry   AH      0C1h
  1490. return  CF      set on error
  1491.         ES      segment of XBIOS data area
  1492. note 1) The XBIOS Data Area is allocated at the high end of
  1493.         conventional memory during the POST sequence.
  1494.      2) The word at 0040:0013h (memory size) is updated to reflect the
  1495.         reduced amount of memory available for DOS and application
  1496.         programs.
  1497.      3) The first byte in the XBIOS Data Area is initialized to its
  1498.         length in Kb.
  1499.      4) A program can determine whether the XBIOS Data Area exists by
  1500.         using int 15h/fn 0C0h.
  1501.  
  1502.  
  1503. Function 0C2h   Pointing Device BIOS Interface
  1504.                 (DesQview 2.x) (PS/2)
  1505. entry   AH      0C2h
  1506.         AL      00h     Enable/Disable Pointing Device
  1507.                         BH      00h     disable
  1508.                                 01h     enable
  1509.                 01h     Reset Pointing Device
  1510.                         Resets the system's mouse or other pointing
  1511.                         device, sets the sample rate, resolution, and
  1512.                         other characteristics to their default values.
  1513.                         return  BH      device ID (0=first)
  1514.                         note 1) After a reset operation, the state of
  1515.                                 the pointing device is as follows:
  1516.                                  disabled;
  1517.                                  sample rate at 100 reports per second;
  1518.                                  resolution at 4 counts per millimeter;
  1519.                                  scaling at 1 to 1.
  1520.                              2) The data package size is unchanged by
  1521.                                 this function.
  1522.                              3) Apps can use the fn 0C2h subfunctions
  1523.                                 to initialize the pointing device to
  1524.                                 other parameters, then enable the
  1525.                                 device with fn 00h.
  1526.                              4) BL is altered on return.
  1527.                 02h     Set Sampling Rate
  1528.                         BH      00h     10/second
  1529.                                 01h     20/second
  1530.                                 02h     40/second
  1531.                                 03h     60/second
  1532.                                 04h     80/second
  1533.                                 05h     100/second  (default)
  1534.                                 06h     200/second
  1535.                 03h     Set Pointing Device Resolution
  1536.                         BH      00h     one count per mm
  1537.                                 01h     two counts per mm
  1538.                                 02h     four counts per mm  (default)
  1539.                                 03h     eight counts per mm
  1540.                 04h     Get Pointing Device Type
  1541.                         return  BH      ID code for the mouse or other
  1542.                                         pointing device
  1543.                 05h     Initialize Pointing Device Interface
  1544.                         Sets the data package size for the system's
  1545.                         mouse or other pointing device, and initializes
  1546.                         the resolution, sampling rate, and scaling to
  1547.                         their default values.
  1548.                         BH      data package size (1 - 8 bytes)
  1549.                         note    After this operation, the state of the
  1550.                                 pointing device is as follows:
  1551.                                 a) disabled;
  1552.                                 b) sample rate at 100 reports per
  1553.                                    second;
  1554.                                 c) resolution at 4 counts per
  1555.                                    millimeter;
  1556.                                 d) scaling set at 1 to 1.
  1557.                 06h     Get Status or Set Scaling Factor
  1558.                         Returns the current status of the system's
  1559.                         mouse or other pointing device or sets the
  1560.                         device's scaling factor.
  1561.                         BH      00h     return device status
  1562.                                 return  BL      status byte
  1563.                                   bits  0       set if right button
  1564.                                                 is pressed
  1565.                                         1       reserved
  1566.                                         2       set if left button
  1567.                                                 is pressed
  1568.                                         3       reserved
  1569.                                         4       0       1:1 scaling
  1570.                                                 1       2:1 scaling
  1571.                                         5       0       device disabled
  1572.                                                 1       device enabled
  1573.                                         6       0       stream mode
  1574.                                                 1       remote mode
  1575.                                         7       reserved
  1576.                                         CL      resolution
  1577.                                                 00h     1 count per mm
  1578.                                                 01h     2 counts per mm
  1579.                                                 02h     4 counts per mm
  1580.                                                 03h     8 counts per mm
  1581.                                         DL      sample rate (hex count)
  1582.                                                 0Ah     10  reports/sec 
  1583.                                                 14h     20  reports/sec
  1584.                                                 28h     40  reports/sec
  1585.                                                 3Ch     60  reports/sec
  1586.                                                 50h     80  reports/sec
  1587.                                                 64h     100 reports/sec
  1588.                                                 0C8h    200 reports/sec
  1589.                                 01h     set scaling to 1:1
  1590.                                 02h     set scaling to 2:1
  1591.                 07h     Set Pointing Device Handler Address
  1592.                         Notifies BIOS pointing device driver of the
  1593.                         address for a routine to be called each time
  1594.                         pointing device data is available.
  1595.                         ES:BX   address of user device handler
  1596.                         return  AL      00h
  1597. return  CF      set on error
  1598.         AH      status
  1599.                 00h     successful
  1600.                 01h     invalid function
  1601.                 02h     invalid input
  1602.                 03h     interface error
  1603.                 04h     need to resend
  1604.                 05h     no device handler installed
  1605. note 1) The values in BH for those functions that take it as input are
  1606.         stored in different locations for each subfunction.
  1607.      2) The user's handler for pointing device data is entered via a
  1608.         FAR call with four parameters on the stack:
  1609.         SS:SP+0Ah    status
  1610.         SS:SP+08h    x coordinate
  1611.         SS:SP+06h    y coordinate
  1612.         SS:SP+04h    z coordinate (always 0)
  1613.          The handler must exit via a far return without removing the
  1614.         parameters from the stack.
  1615.      3) The status parameter word passed to the user's handler is
  1616.         interpreted as follows:
  1617.         bits    0       left button pressed
  1618.                 1       right button pressed
  1619.                 2-3     reserved
  1620.                 4       sign of x data is negative
  1621.                 5       sign of y data is negative
  1622.                 6       x data has overflowed
  1623.                 7       y data has overflowed
  1624.                 8-0Fh   reserved
  1625.  
  1626.  
  1627. Function 0C3h   Enable/Disable Watchdog Timeout
  1628.                 (PS/2 50+, EISA)
  1629. entry   AH      0C3h
  1630.         AL      00h     disable watchdog
  1631.                 01h     enable watchdog
  1632.                         BX      timer counter
  1633. return  CF      set on error
  1634. note 1) The watchdog timer generates an NMI.
  1635.      2) This would be subject to protection with a real OS so temporary
  1636.         masters would not be able to seize the bus forever.
  1637.  
  1638.  
  1639. Function 0C3h   Fail-Safe Timer Control
  1640.                 (EISA)
  1641. entry   AH      0C3h
  1642.         AL      00h     disable fail-safe timer
  1643.         AL      01h     enable fail-safe timer
  1644.                 BX      timer count value
  1645. return  CF      clear   OK
  1646.                 set     invalid input
  1647. note 1) Fn 00h clears WDTIC in the Extended BIOS Data Area.
  1648.      2) Fn 01h puts the timer in Mode 0, enables the fail-safe timer
  1649.         NMI, places the value in BX in the WDTIC.  When BX counts to
  1650.         zero a fail-safe timer NMI is generated.
  1651.  
  1652.  
  1653. Function 0C4h   Programmable Option Select
  1654.                 (PS/2 50+)
  1655. entry   AH      0C4h
  1656.         AL      00h     return base POS register address
  1657.                 01h     enable slot
  1658.                         BL      slot number
  1659.                 02h     enable adapter
  1660. return  CF      set on error
  1661.         DX      base POS register address (if function 00h)
  1662. note 1) Fn 00h returns the base Programmable Option Select register
  1663.         address, enables a slot for setup, or enables an adapter.
  1664.      2) Valid on machines with Micro Channel Architecture (MCA) bus
  1665.         only.
  1666.      3) After a slot is enabled with fn 01h, specific information can
  1667.         be obtained for the adapter in that slot by performing port
  1668.         input operations:
  1669.         Port    Function
  1670.         100h    MCA ID (low byte)
  1671.         101h    MCA ID (high byte)
  1672.         102h    Option Select Byte 1
  1673.             bit 0       0       if disabled
  1674.                         1       if enabled
  1675.         103h    Option Select Byte 2
  1676.         104h    Option Select Byte 3
  1677.         105h    Option Select Byte 4
  1678.                 bits 6-7 are channel check indicators
  1679.         106h    Subaddress Extension (low byte)
  1680.         107h    Subaddress Extension (high byte)
  1681.  
  1682.  
  1683. Function 0C5h   Used by PS/2 Model 50+ and Olivetti MCA machines
  1684.                 Used by Desqview 2.2
  1685.                 Used by Lotus 123 Release 2.2
  1686.                 Used by Microsoft Word 5.0
  1687. note    Functions unknown.  Reported by InfoWorld Nov 13 1989's Micro
  1688.         Channel 386 test as a conflict between the above software
  1689.         packages.  InfoWorld said that Quarterdeck (DESQview) was
  1690.         working on a fix for their product.  No other information.
  1691.  
  1692.  
  1693. Function 0D8h   Access System Information
  1694.                 (EISA)
  1695. entry   AH      0D8h    Read Slot Information
  1696.         AL      00h     (CS specifies 16-bit addressing)
  1697.         AL      80h     (CS specifies 32-bit addressing)
  1698.         CL      slot number (0-63)
  1699. return  AH      status
  1700.                 00h     OK
  1701.                 80h     invalid slot number
  1702.                 82h     extended CMOS RAM corrupted
  1703.                 83h     specified slot is empty
  1704.                 86h     invalid BIOS call
  1705.                 87h     invalid system configuration
  1706.         AL      miscellaneous vendor information byte
  1707.                 bits 7  duplicate IDs exist
  1708.                      6  product ID
  1709.                    5,4  slot type
  1710.                         0,0  expansion slot
  1711.                         0,1  embedded device
  1712.                         1,0  virtual device
  1713.                         1,1  reserved by EISA
  1714.                    3,0  duplicate ID number
  1715.                         0,0,0,0   no duplicated IDs
  1716.                         0,0,0,1   first duplicate ID
  1717.                         -------
  1718.                         1,1,1,1   15th duplicate ID
  1719.         BH      configuration utility, major version number
  1720.         BL      configuration utility, minor version number
  1721.         CH      configuration file, MSD of checksum
  1722.         CL      configuration file, LSD of checksum
  1723.         DH      number of device functions
  1724.         DL      combined function information
  1725.         SI:DI   four byte compressed vendor ID
  1726.         CF      clear   OK
  1727.                 set     error
  1728.                 AH      will be nonzero if an error occurs
  1729.  
  1730.  
  1731. entry   AH      0D8h    Read Function Information
  1732.         AL      01h     (CS specifies 16-bit addressing)
  1733.         AL      81h     (CS specifies 32-bit addressing)
  1734.         CH      function number (0-n-1)
  1735.         CL      slot number (0-63)
  1736.         DS:SI   address pointer for output data
  1737. return  AH      status
  1738.                 00h     OK
  1739.                 80h     invalid slot number
  1740.                 82h     extended CMOS RAM corrupted
  1741.                 83h     specified slot is empty
  1742.                 86h     invalid BIOS call
  1743.                 87h     invalid system configuration
  1744.         DS      segment for return data buffer
  1745.         SI      offset for return data buffer (16 bit)
  1746.        ESI      offset for return data buffer (32 bit)
  1747. note    320-byte data buffer:
  1748.         offset size     description
  1749.         00h     2 words compressed ID
  1750.                         byte 0
  1751.                         bits 7  reserved
  1752.                            6-2  character 1
  1753.                            1-0  character 2
  1754.  
  1755.                         byte 1
  1756.                            7-5  character 2
  1757.                            4-0  character 3
  1758.  
  1759.                         byte 2
  1760.                            7-4  second digit of product number
  1761.                            3-0  first digit of product number
  1762.  
  1763.                         byte 3
  1764.                            7-4  third digit of product number
  1765.                            3-0  product revision number
  1766.         04h     1 word  ID and slot information
  1767.                         byte 0
  1768.                         bits 7  0  no duplicate ID is present
  1769.                                 1  duplicate ID is present
  1770.                              6  0  ID is readable
  1771.                                 1  ID is not readable
  1772.                            5-4  slot type
  1773.                                 0,0  expansion slot
  1774.                                 0,1  embedded slot
  1775.                                 1,0  virtual slot
  1776.                                 1,1  reserved by EISA
  1777.                            3,0  duplicate ID number
  1778.                                 0,0,0,0   no duplicated IDs
  1779.                                 0,0,0,1   first duplicate ID
  1780.                                 -------
  1781.                                 1,1,1,1   15th duplicate ID
  1782.  
  1783.                         byte 1  
  1784.                         bits 7  0  configuration complete
  1785.                                 1  configuration not complete
  1786.                            6-2  reserved by EISA
  1787.                              1  0  EISA IOCHKERR not supported
  1788.                                 1  EISA IOCHKERR supported
  1789.                              0  0  EISA ENABLE not supported
  1790.                                 1  EISA ENABLE supported
  1791.  
  1792.         06h     1 word  configuration file extension revision level
  1793.                         byte 0  minor revision level
  1794.                         byte 1  major revision level
  1795.  
  1796.         07h     13words Selections
  1797.                         byte 0  first selection
  1798.                         byte 1  second selection
  1799.                         ---- -  ----------------
  1800.                         byte 25 twenty-sixth selection
  1801.  
  1802.         022h    1 byte  Function Information
  1803.                         bits 7  0  function is enabled
  1804.                                 1  function is disabled
  1805.                              6  configuration extension free-form data
  1806.                              5  port initialization entries follow
  1807.                              4  port range entries follow
  1808.                              3  DMA entries follow
  1809.                              2  interrupt entries follow
  1810.                              1  memory entries follow
  1811.                              0  type/subtype entries follow
  1812.  
  1813.         023h    80bytes Type and subtype ASCII string
  1814.                         (strings less than 80 characters padded with
  1815.                          zeroes)
  1816.                         byte 0  first ASCII character
  1817.                         byte 1  second ASCII character
  1818.                         ---- -- ----------------------
  1819.                         byte 79 eightieth ASCII character
  1820.  
  1821.         073h    205byts Free-Form Data Field
  1822.                         If Function Information byte 6 IS set, the
  1823.                         next 205 bytes (to the end of the 320-byte data
  1824.                         block) is a free-form data field.  Byte 0 is
  1825.                         the length of the field in bytes, and data
  1826.                         starts with byte 1.
  1827.  
  1828.         073h    63bytes Memory configuration information
  1829.                         (if Function Information bit 6 NOT set)
  1830.                         byte 0
  1831.                         bits 7  0  last entry
  1832.                                 1  more entries follow
  1833.                              6  reserved by EISA
  1834.                              5  0  unshared memory
  1835.                                 1  shared memory
  1836.                            4,3  memory type
  1837.                                 0,0  SYS (base or extended)
  1838.                                 0,1  EXP (expanded)
  1839.                                 1,0  VIR (virtual)
  1840.                                 1,1  OTH (other)
  1841.                              2  reserved by EISA
  1842.                              1  0  not cached
  1843.                                 1  cached
  1844.                              0  0  read only (ROM)
  1845.                                 1  read/write (RAM)
  1846.  
  1847.                         byte 1
  1848.                            7-4  reserved by EISA
  1849.                            3,2  decode size
  1850.                                 0,0  20
  1851.                                 0,1  24
  1852.                                 1,0  32
  1853.                                 1,1  reserved by EISA
  1854.                            1,0  data size (access size)
  1855.                                 0,0  byte
  1856.                                 0,1  word
  1857.                                 1,0  doubleword
  1858.                                 1,1  reserved by EISA
  1859.  
  1860.                         bytes 2-4  memory start address divided by 100h
  1861.  
  1862.                         bytes 5-6  memory size divided by 400h
  1863.  
  1864.                         Up to 8 more 7-byte entries may follow.
  1865.  
  1866.         0B2h    14bytes Interrupt Configuration
  1867.                         (if Function Information bit 6 is NOT set)
  1868.                         byte 0
  1869.                         bits 7  0  last entry
  1870.                                 1  more entries follow
  1871.                              6  0  not shared
  1872.                                 1  shared
  1873.                              5  0  edge triggered
  1874.                                 1  level triggered
  1875.                              4  reserved by EISA
  1876.                            3-0  interrupt (0-F)
  1877.  
  1878.                         byte 1  reserved by EISA
  1879.  
  1880.                         Up to 6 more 2-byte entries may follow.
  1881.  
  1882.         0C0h    4 words DMA Channel Description
  1883.                         (if Function Information bit 6 is NOT set)
  1884.                         byte 0
  1885.                         bits 7  0  last entry
  1886.                                 1  more entries follow
  1887.                              6  0  not shared
  1888.                                 1  shared
  1889.                            5-3  reserved by EISA
  1890.                            2-0  DMA channel number (0-7)
  1891.  
  1892.                         byte 1
  1893.                            7,6  reserved by EISA
  1894.                            5,4  data timing
  1895.                                 0,0  default (ISA competible)
  1896.                                 0,1  type A
  1897.                                 1,0  type B
  1898.                                 1,1  type C (burst mode)
  1899.                            3,2  transfer size
  1900.                                 0,0  8-bit
  1901.                                 0,1  16-bit
  1902.                                 1,0  32-bit
  1903.                                 1,1  reserved by EISA
  1904.                            1,0  reserved by EISA
  1905.  
  1906.                         Up to 3 more 2-byte entries may follow
  1907.  
  1908.         0C8h    60bytes Port I/O Information
  1909.                         byte 0
  1910.                         bits 7  0  last entry
  1911.                                 1  more entries follow
  1912.                              6  0  not shared
  1913.                                 1  shared
  1914.                              5  reserved by EISA
  1915.                            4-0  number of sequential ports, less 1
  1916.  
  1917.                         bytes 1,2  I/O Port Address
  1918.  
  1919.                         Up to 19 more 3-byte entries may follow
  1920.  
  1921.         104h    60bytes Initialization Data
  1922.                         (If Function Information bit 6 is NOT set)
  1923.                         byte 0  Initialization Type
  1924.                         bits 7  0  last entry
  1925.                                 1  more entries follow
  1926.                            6-3  reserved by EISA
  1927.                              2  port value or mask value
  1928.                                 0  write to port without mask
  1929.                                 1  write to port with mask
  1930.                            2,0  type of access
  1931.                                 0,0  byte addressable
  1932.                                 0,1  word addressable
  1933.                                 1,0  doubleword addressable
  1934.                                 1,1  reserved by EISA
  1935.  
  1936.                         bytes 1,2   I/O Port address
  1937.  
  1938.                         bytes 3-10  (Depends on value of byte 0, bit 2)
  1939.                                 if bit=0, bytes 3-6 will have the
  1940.                                 following values based on the access
  1941.                                 type specified by byte 0, bits 0-1:
  1942.  
  1943.                                 byte 0, bits 0-1:
  1944.                                    0,0   this byte 3 - port value
  1945.                                    0,1   this bytes 3,4 - port value
  1946.                                    1,0   this bytes 3-6 - port value
  1947.                                    1,1   reserved by EISA
  1948.  
  1949.                                 if bit=1, bytes 3-10 will have the
  1950.                                 following values based on the access
  1951.                                 type specified by byte 0, bits 0-1:
  1952.  
  1953.                                 byte 0, bits 0-1:
  1954.                                    0,0   this byte 3 - port value
  1955.                                                    4 - port mask
  1956.                                    0,1   this bytes 3,4 - port value
  1957.                                                     5,6 - port mask
  1958.                                    1,0   this bytes 3-6 - port value
  1959.                                                     7-10 - port mask
  1960.                                    1,1   reserved by EISA
  1961.  
  1962.                                 Up to 7 more 4, 5, 7, or 11-byte entries
  1963.                                 may follow.
  1964.  
  1965.  
  1966. entry   AH      0D8h    Clear Configuration Storage
  1967.         AL      02h     (CS specifies 16-bit addressing)
  1968.         AL      82h     (CS specifies 32-bit addressing)
  1969.         BH      configuration utility major revision level
  1970.         BL      configuration utility minor revision level
  1971. return  AH      00h     OK
  1972.                 84h     error writing to extended CMOS RAM
  1973.                 86h     invalid BIOS call
  1974.                 88h     configuration utility not supported
  1975.  
  1976.  
  1977. entry   AH      0D8h    Write Function Information
  1978.         AL      03h     (CS specifies 16-bit addressing)          
  1979.         AL      83h     (CS specifies 32-bit addressing)     
  1980.         CX      length of data structure (in bytes)
  1981.         DS      segment of data buffer
  1982.         SI      offset of data buffer (16-bit)
  1983.        ESI      offset of data buffer (32-bit)
  1984. return  AH      00h     OK
  1985.                 84h     error writing to extended CMOS RAM
  1986.                 85h     CMOS RAM is full
  1987.                 86h     invalid BIOS call
  1988.  
  1989. note    See Function 1 for data fields.
  1990.  
  1991.  
  1992.  
  1993. Function 0DEh   DESQview Services                           (DESQview)
  1994.  
  1995.  
  1996. ┌─────────────────────────────────────────────────────────────────────┐
  1997. │Interrupt 16h  Keyboard I/O                                    3**9  │
  1998. └─────────────────────────────────────────────────────────────────────┘
  1999. (0:0058h)       Access the keyboard.  Scancodes are found in Appendix
  2000.                 1.  ASCII codes are found in Appendix 2.
  2001.  
  2002.                 IBM's original keyboard layout is referred to as the
  2003.                 84-key or "old style".  It has the function keys on the
  2004.                 left and an embedded cursor/numeric keypad on the
  2005.                 right.  The 101-key "new style" or "enhanced" keyboard
  2006.                 (such as used on the PS/2s) adds several keys.  The
  2007.                 early BIOS will not detect the new scancodes and the
  2008.                 new BIOS for some reason added new function calls for
  2009.                 this purpose instead of enhancing the old ones.  This
  2010.                 causes some hassle when writing programs which need to
  2011.                 support both keyboards fully.  Most programs limit
  2012.                 themselves to the 84-key functions in the interest of
  2013.                 backward compatibility.
  2014.  
  2015.                 The SWITCHES CONFIG.SYS command forces DOS 4.0 to use
  2016.                 the standard int 16h requests for keyboard I/O rather
  2017.                 than the extended int 16h requests.
  2018.  
  2019.                 The DOS KEYB command does not hook into the BIOS.  It
  2020.                 is a total replacement for the BIOS int9 driver.  The
  2021.                 only good thing about this is that you can use 101-key
  2022.                 keyboards on old ATs without support for enhanced
  2023.                 keyboards.  KEYB is very peculiar in its handling of
  2024.                 the keyboard, causing some programs to break.  It also
  2025.                 tends to disable interrupts for a long time while
  2026.                 processing each scan code.
  2027.  
  2028.                 There are machines such as the Toshiba 5200 which have
  2029.                 84-key layouts but "simulate" being 101-key, at least
  2030.                 as far as int 16h goes.  (always good for confusing
  2031.                 your software...)
  2032.  
  2033.                 IBM's TopView saved the state of the capslock,
  2034.                 scrollock, and numlock keys during task switches.
  2035.                 DESQview does not save the toggle states unless you
  2036.                 change the default setup.
  2037.  
  2038. Function  00h   Get Keyboard Input
  2039.                 Read the next character in keyboard buffer, if no key
  2040.                 is ready, then wait for one.
  2041. entry   AH      00h
  2042. return  AH      scan code
  2043.         AL      ASCII character
  2044. note 1) Removes keystroke from buffer (destructive read).
  2045.      2) Does not work with the extra keys on the 101-key "enhanced"
  2046.         keyboard.
  2047.  
  2048.  
  2049. Function  01h   Check Keystroke Buffer - Do Not Clear
  2050. entry   AH      01h
  2051. return  ZF      0 (clear) if character in buffer
  2052.                 1 (set)   if no character in buffer
  2053.         AH      scan code of character (if ZF=0)
  2054.         AL      ASCII character if applicable
  2055. note 1) Keystroke is not removed from buffer.  The same character and
  2056.         scan code will be returned by the next call to Int 16h/fn 00h.
  2057.      2) This call flushes the 101-key codes from the buffer if they
  2058.         precede an 84-key code.
  2059.  
  2060.  
  2061. Function  02h   Shift Status
  2062.                 Fetches bit flags indicating shift status.
  2063. entry   AH      02h
  2064. return  AL      status byte (same as [0040:0017])
  2065.            bits 7       Insert on
  2066.                 6       CapsLock on
  2067.                 5       NumLock on
  2068.                 4       ScrollLock on
  2069.                 3       Alt key down
  2070.                 2       Control key down
  2071.                 1       Left shift (left caps-shift key) down
  2072.                 0       Right shift (right caps-shift key) down
  2073. note    The Keyboard Flags Byte is stored in the BIOS Data Area at
  2074.         0000:0417h.
  2075.  
  2076.  
  2077. Function 03h    Keyboard - Set Repeat Rate
  2078.                 (PCjr, AT, XT/286, PS/2)
  2079. entry   AH      03h
  2080.         AL      00h     reset typematic defaults                (PCjr)
  2081.                 01h     increase initial delay                  (PCjr)
  2082.                 02h     decrease repeat rate by 1/2             (PCjr)
  2083.                 03h     increase both delays by 1/2             (PCjr)
  2084.                 04h     turn off typematic                      (PCjr)
  2085.                 05h     set typematic rate                  (AT, PS/2)
  2086.         BH      00h-03h for delays of 250ms, 500ms, 750ms, or 1 second
  2087.                         0,0     250ms
  2088.                         0,1     500ms
  2089.                         1,0     750ms
  2090.                         1,1     1 second
  2091.         BL      00h-1Fh for typematic rates of 30cps down to 2cps
  2092.                         00000 30     01011 10.9   10101 4.5
  2093.                         00001 26.7   01100 10     10110 4.3
  2094.                         00010 24     01101 9.2    10111 4
  2095.                         00011 21.8   01110 8.6    11000 3.7
  2096.                         00100 20     01111 8      11001 3.3
  2097.                         00101 18.5   10000 7.5    11010 3
  2098.                         00110 17.1   10001 6.7    11011 2.7
  2099.                         00111 16     10010 6      11100 2.5
  2100.                         01000 15     10011 5.5    11101 2.3
  2101.                         01001 13.3   10011 5.5    11110 2.1
  2102.                         01010 12     10100 5      11111 2
  2103. return  nothing
  2104. note 1) Subfunction 05h is available on ATs with ROM BIOS dated
  2105.         11/15/85 and later, the XT/286, and the PS/2.
  2106.      2) Subfunction 0 (Return to Default Keyboard State) restores the
  2107.         keyboard to its original state.  An IBM AT's original state at
  2108.         power-on is typematic on, normal initial delay and normal
  2109.         typematic rate.
  2110.      3) Subfunction 1 (Increase Initial Delay) increases the delay
  2111.         between the first character typed and the burst of typematic
  2112.         characters.
  2113.      4) For Subfunctions 0 through 4, each time the typematic rate is
  2114.         changed, all previous states are removed.
  2115.      5) Some clone keyboards (Northgate Omnikey and Focus) and 
  2116.         BIOSES (AMI) have much higher repeat rates for the same bit
  2117.         values.
  2118.  
  2119.  
  2120. Function 04h    Keyboard Click Toggle
  2121.                 (PCjr and Convertible)
  2122. entry   AH      04h
  2123.         AL      00h     for click off
  2124.                 01h     for click on
  2125. return  nothing
  2126.  
  2127.  
  2128. Function 05h    Load Keyboard Buffer
  2129.                 (AT or PS/2 with enhanced kbd)
  2130. entry   AH      05h
  2131.         CH      scan code
  2132.         CL      ASCII character
  2133. return  CF      set on error
  2134.         AL      00h     success
  2135.                 01h     if buffer full
  2136. note    Places a character and scan code at the end of the keyboard
  2137.         type-ahead buffer.
  2138.  
  2139.  
  2140. Function 06h    Keyboard Buffer Write           (Fansi-Console to 2.00)
  2141. entry   AH      06h
  2142.         BX      extended key value to place in typeahead buffer
  2143. return  unknown
  2144. note    This call may be dropped since it now duplicates function 05h.
  2145.  
  2146.  
  2147. Function 07h    Change Shift Key Status         (Fansi-Console to 2.00)
  2148. entry   AH      07h
  2149.         AL      shift key status value
  2150. return  unknown
  2151. note    Status byte is same as function 02h.
  2152.  
  2153.  
  2154. Function 10h    Get Enhanced Keystroke And Read 
  2155.                 (XT/286, PS/2, AT with "Enhanced" keyboard)
  2156. entry   AH      10h
  2157. return  AH      scan code
  2158.         AL      ASCII character if applicable
  2159. note 1) Reads a character and scan code from the keyboard type-ahead
  2160.         buffer.
  2161.      2) Use this function for the enhanced keyboard instead of int 16h
  2162.         fn 00h.  It allows applications to obtain the scan codes for
  2163.         the additional F11, F12, and cursor control keys.
  2164.      3) This is the enhanced version of function 00h.
  2165.  
  2166.  
  2167. Function 11h    Check Enhanced Keystroke
  2168.                 (XT/286, PS/2, AT with "Enhanced" keyboard)
  2169. entry   AH      11h
  2170. return  ZF      0       (clear) if key pressed
  2171.                         AH      scan code
  2172.                         AL      ASCII character if applicable
  2173.                 1       if buffer is empty
  2174. note 1) Keystroke is not removed from buffer.  The same char and scan
  2175.         code will be returned by the next call to Int 16h/fn 10h.
  2176.      2) Use this function for the enhanced keyboard instead of int
  2177.         16h/fn 00h.  It allows applications to test for the additional
  2178.         F11, F12, and cursor control keys.
  2179.  
  2180.  
  2181. Function 12h    Extended Get Shift Status  (F11, F12 Enhanced keyboard)
  2182. entry   AH      12h
  2183. return  AX      status word
  2184.                 AL bit  0       right Shift key depressed
  2185.                         1       left Shift key depressed
  2186.                         2       Control key depressed
  2187.                         3       Alt key depressed
  2188.                         4       ScrollLock state active
  2189.                         5       NumLock state active
  2190.                         6       CapsLock state active
  2191.                         7       insert state is active
  2192.                 AH bit  0       left Control key pressed
  2193.                         1       left Alt key depressed
  2194.                         2       right Control key pressed
  2195.                         3       right Alt key depressed
  2196.                         4       Scroll Lock key depressed
  2197.                         5       NumLock key depressed
  2198.                         6       CapsLock key depressed
  2199.                         7       SysReq key depressed
  2200. note    Use this function for the enhanced keyboard instead of int
  2201.         16h/fn 02h.
  2202.  
  2203.  
  2204. Function  4fh   Gerkey - German keyboard remapper from OVI-SYSTEM
  2205. entry   AH      4Fh     Gerkey function
  2206.         AL      56h     installation check
  2207. return  AX      0FFFFh  installed, otherwise not present
  2208.         BH      major version
  2209.         BL      minor version
  2210.  
  2211.  
  2212. Function  70h, 71h, 72h  Internal Functions    (SEAware's FAKEY.COM)
  2213. note    FAKEY.COM is a TSR keyboard utility distributed to registered
  2214.         users of SEAware products.
  2215.  
  2216.  
  2217. Function  75h   Set Tick Count for Scanning       (pcAnywhere 2.00)
  2218. entry   AH      75h
  2219.         AL      tick count
  2220. return  none
  2221. note 1) Sets count of 55ms timer ticks between checks for new screen
  2222.         changes.
  2223.      2) pcAnywhere is a program that allows operation of a remote
  2224.         machine over a serial link.
  2225.  
  2226.  
  2227. Function  76h   Set Error Checking Mode           (pcAnywhere 2.00)
  2228. entry   AH      76h
  2229.         AL      error checking type
  2230.                 00h     none
  2231.                 01h     fast
  2232.                 02h     slow
  2233. return  none
  2234.  
  2235.  
  2236. Function  77h   reserved                          (pcAnywhere 2.00)
  2237. pcAnywhere API - reserved
  2238.  
  2239.  
  2240. Function  78h   Log Off                           (pcAnywhere 2.00)
  2241. entry   AL      00h     wait for another call
  2242.                 01h     exit but remain TSR
  2243.                 02h     automatic mode - watches DTR
  2244.                 0FFh    leave in current operating mode  (ver. 2.1)
  2245. return  none
  2246.  
  2247.  
  2248. Function  79h   Installation Check                (pcAnywhere 2.00)
  2249. entry   AH      79h
  2250.         AL      00h     installation check
  2251. return  AX      0FFFFh  resident and active
  2252.                 0FFFEh  resident but not active
  2253.                 0FFFDh  resident TSR
  2254.                 0FFFCh  automatic mode
  2255.                 any other value - not resident
  2256.  
  2257.  
  2258. Function  7Ah   Cancel pcAnywhere Session         (pcAnywhere 2.00)
  2259. entry   AH      7Ah
  2260. return  none
  2261. note    Leaves pcAnywhere resident but unable to answer another call.
  2262.  
  2263.  
  2264. Function  7Bh   Enable/Disable Operation          (pcAnywhere 2.00)
  2265. entry   AH      7Bh
  2266.         AL      state
  2267.                 00h     disabled
  2268.                 01h     enabled
  2269. return  none
  2270. note    Remote screen is automatically refreshed when session is enabled.
  2271.  
  2272.  
  2273. Function  7Ch   Get Port Configuration            (pcAnywhere 2.00)
  2274. entry   AH      7Ch
  2275. return  AH      port number in binary (0-15)
  2276.         AL      baud rate
  2277.                 00h     50
  2278.                 01h     75
  2279.                 02h     110
  2280.                 03h     134.5
  2281.                 04h     150
  2282.                 05h     300
  2283.                 06h     600
  2284.                 07h     1200
  2285.                 08h     1800
  2286.                 09h     2000
  2287.                 0Ah     2400
  2288.                 0Bh     4800
  2289.                 0Ch     7200
  2290.                 0Dh     9600
  2291.                 0Fh     19,200
  2292.  
  2293.  
  2294. Function  7Dh   Get/Set Terminal Parameters       (pcAnywhere 2.00)
  2295. entry   AH      7Dh
  2296.         AL      00h     set parameters
  2297.                 01h     get parameters
  2298.                 02h     get configuration header and terminal
  2299.                         parameters
  2300.         CX:DS   address of Terminal Parameter Block
  2301. return  AL      00h     nothing
  2302.                 01h     current Terminal Parameter Block in CX:DS
  2303.                 02h     configuration header and Terminal Parameter
  2304.                         Block in CX:DS
  2305. note    Terminal Parameter Block format:   (1152 bytes) (decimal)
  2306.         384 bytes  CRT Control Information
  2307.                 bytes   function
  2308.                 1-8     cursor up
  2309.                9-16     cursor down
  2310.               17-24     cursor left
  2311.               25-32     cursor right
  2312.               33-40     cursor home
  2313.               41-48     clear screen
  2314.               49-56     clear to end of line
  2315.               57-64     clear to end of page
  2316.               65-72     insert line
  2317.               73-80     delete line
  2318.               81-88     insert character
  2319.               89-96     delete character
  2320.              97-104     cursor position lead in
  2321.             105-112     between row and column
  2322.             113-120     after cursor position
  2323.             121-128     CRT initialization
  2324.         256 bytes  Character Translation Table
  2325.                 translates ASCII characters from host.  Normally
  2326.                 changes IBM graphics characters to other displayable
  2327.                 symbols
  2328.         512 bytes  keyboard sequences
  2329.             641-644     cursor up
  2330.             645-648     cursor down
  2331.             649-652     cursor left
  2332.             653-656     cursor right
  2333.             657-660     home
  2334.             661-664     end
  2335.             665-668     PgUp
  2336.             669-672     PgDn
  2337.             673-676     insert
  2338.             677-680     delete
  2339.             681-684     control-home
  2340.             685-688     control-end
  2341.             689-692     control-PgUp
  2342.             693-696     control-PgDn
  2343.             697-700     escape
  2344.             701-740     F1...F10
  2345.             741-780     sF1...sF10
  2346.             781-820     ^F1...^F10
  2347.             821-860     aF1...aF10
  2348.             861-964     alt A-Z
  2349.            965-1004     alt 0-9
  2350.           1005-1008     alt =
  2351.           1009-1012     alt -
  2352.           1013-1016     print screen
  2353.           1017-1020     ctrl-left arrow
  2354.           1021-1024     ctrl-right arrow
  2355.           1025-1120     reserved
  2356.           1121-1124     begin conv. mode
  2357.           1125-1128     remote printing off
  2358.           1129-1132     remote printing on
  2359.           1133-1136     backspace
  2360.           1137-1140     refresh screen
  2361.           1141-1144     send next code
  2362.           1145-1148     display top 24 lines
  2363.           1149-1152     display bottom 24 lines
  2364.  
  2365.  
  2366. Function  7Eh   Serial I/O Through pcAnywhere Port   (pcAnywhere 2.00)
  2367. entry   AH      7Eh
  2368.         AL      I/O function
  2369.                 01h     get port input status
  2370.                 02h     get port input character
  2371.                 03h     output character
  2372.                 04h     hang up phone
  2373.         CX      ASCII character to output (fn 03h)
  2374. return  (if AL=01h)
  2375.         AX      00h     no character ready
  2376.                 01h     character is available
  2377.         (if AL=02h)
  2378.         AL      ASCII code received
  2379.  
  2380.  
  2381. Function  7Fh   Set Keyboard/Screen Mode            (pcAnywhere 2.00)
  2382. entry   AH      7Fh
  2383.         AL      parameters
  2384.                 00h     enable remote keyboard only  |
  2385.                 01h     enable host keyboard only    |  keyboard group
  2386.                 02h     enable both keyboards        |
  2387.  
  2388.                 08h     display top 24 lines         |  screen group
  2389.                 09h     display bottom 24 lines      |
  2390.  
  2391.                 10h     Hayes modem                  |
  2392.                 11h     other modems                 |  modem group
  2393.                 12h     direct connect               |
  2394.  
  2395.  
  2396. Function 0A5h   Central Point Software PC-Tools PC-CACHE 6.0 and later
  2397. entry   AH      0A5h    installation check
  2398.         AL      0FFh
  2399.         CX      1111h   magic number
  2400. return  CH      00h     installed
  2401. note    DOS Disk Reset call will also flush the cache from mid
  2402.         version 6 on.
  2403.  
  2404. Function 0AFh   Central Point Software PC-Tools PC-CACHE 5.x
  2405. entry   AH      0AFh    flush cache
  2406.         AL      0FFh
  2407.         CX      0FFFFh  magic number
  2408. return  unknown
  2409. note    This is safe, even if PC Cache in not installed.
  2410.  
  2411.  
  2412. Function 0EDh   Borland Turbo Lightning API  (partial)
  2413. entry   AH      0EDh
  2414.         BH      0EDh
  2415.         BL      function
  2416.                 00h     installation check
  2417.                 02h     pointer to Lightning internal data structure
  2418.                         low byte
  2419.                 03h     pointer to Lightning internal data structure
  2420.                         high byte
  2421.                 04h     load auxiliary dictionary
  2422.                 06h     autoproof mode
  2423.                 0Fh     get number of substitutions (segment)
  2424.         DS:DI   pointer to string to be processed
  2425. return  AX      error code (unknown)
  2426. note    I've made several attempts to get a copy of the Turbo
  2427.         Lightning API, which was originally supposed to be available
  2428.         for developers in 1985.  In 1988 Borland sent me a letter
  2429.         saying they were still working on it.  In late 1989 the Borland
  2430.         rep on BIX told me basically that there were no plans for
  2431.         releasing the API any more.  The information here was dredged
  2432.         from Chris Dunford's LSPELL.PAS interface into Lighting.
  2433.  
  2434.  
  2435. Function 0F0h   Set CPU speed                            (Compaq 386)
  2436. entry   AH      0F0h    set speed
  2437.         AL      speed
  2438.                 00h     equivalent to 6 mHz 80286 (COMMON)
  2439.                 01h     equivalent to 8 mHz 80286 (FAST)
  2440.                 02h     full 16 mHz (HIGH)
  2441.                 03h     toggles between 8 MHz-equivalent and speed
  2442.                         set by system board switch (AUTO or HIGH)
  2443.                 04h-07h unknown
  2444.                 08h     full 16 MHz except 8 MHz-equivalent during
  2445.                         floppy disk access
  2446.                 09h     specify speed directly
  2447.                         CX      speed value, 1 (slowest) to 50 (full),
  2448.                                 3 ~=8088
  2449. return  none?
  2450. note 1) Used by Compaq DOS MODE command.
  2451.  
  2452.  
  2453. Function 0F1h   Read Current CPU Speed                    (Compaq 386)
  2454. entry   AH      0F1h
  2455. return  AL      speed code (see function 0F0h above)
  2456.                 if AL=09h, CX=speed code
  2457.  
  2458.  
  2459. Function 0F2h   Determine Attached Keyboard Type          (Compaq 386)
  2460. entry   AH      0F2h
  2461. return  AL      type
  2462.                 00h     if 11-bit AT keyboard is in use
  2463.                 01h     if 9-bit PC keyboard is in use
  2464.  
  2465.  
  2466. Function 0FFh   PC-Tools API
  2467. entry   AH      0FFh
  2468.         AL      0A5h    detect PC-Cache disk cache (ver 5.0 & later)
  2469.                 CH      11h
  2470.                 CL      11h
  2471. return  CH      00h     cache is present
  2472. note    PC-Tools is a Swiss-army-knife software package with an
  2473.         editor, DOS shell, cache, disk optimizer, and several other
  2474.         functions from Central Point Software.
  2475.  
  2476.  
  2477. Function 0FFh   PC-Tools API
  2478. entry   AH      0AFh
  2479.         AL      0AFh    flush PC-Cache disk cache (from mid-version-6)
  2480.                 CH      0FFh
  2481.                 CL      0FFh
  2482. return  none
  2483. note    PC-Tools is a Swiss-army-knife software package with an
  2484.         editor, DOS shell, cache, disk optimizer, and several other
  2485.         functions from Central Point Software.
  2486.  
  2487.  
  2488. Function 0FFh   2-The-Max VGA-16 Board
  2489. entry   AH      0FFh    query zoom interrupt
  2490. return  AL      zoom interrupt number
  2491.         AL+1    old BIOS keyboard handler interrupt number
  2492.         BX      hot key
  2493.  
  2494.  
  2495. Function 0FFh   Programmer Interface to Carbon Copy Plus (5.0)
  2496. entry   AH      0FFh
  2497.         AL      00h     check connection between CC and CCHELP
  2498. return  BL      00h     Carbon Copy not connected to CCHELP
  2499.                 01h     Carbon Copy is connected to CCHELP
  2500.  
  2501. entry   AL      01h     disconnects and resets the line if the Host
  2502.                         or CC side is connected to CCHELP
  2503.  
  2504. entry   AL      02h     return a pointer to the last phone number
  2505.                         dialed by CC
  2506. return  ES:DI           dword pointer to ASCIIZ phone number string
  2507.  
  2508.  
  2509.  
  2510. ┌────────────────────────────────────────────────────────────────────┐
  2511. │Interrupt 17h  Printer                                        3**10 │
  2512. └────────────────────────────────────────────────────────────────────┘
  2513. (0:005Ch)       Access the parallel printer(s)
  2514.                 AH is changed.  All other registers left alone.
  2515.  
  2516.                 Printer ports vary widely in compatibility, since the
  2517.                 original IBM MDA's parallel port did not match its own
  2518.                 spec.  Many parallel ports do not use IRQ7 at all.
  2519.  
  2520.                 The parallel port on a monochrome adapter is at 3BCh.
  2521.                 The port on a parallel printer adapter is at 378h or
  2522.                 278h.  At boot time, the BIOS looks at them in the
  2523.                 order 3BCh, 378h, 278h, and assigns the first port it
  2524.                 finds to LPT1, the second to LPT2, etc.  If you have a
  2525.                 monochrome adapter, LPT1 is probably 3BCh; otherwise,
  2526.                 it is probably 378h.
  2527.  
  2528.  
  2529. Function  00h   Print Character/send AL to printer DX (0, 1, or 2)
  2530. entry   AH      00h
  2531.         AL      ASCII character code
  2532.         DX      printer to be used
  2533.                 00h     PRN or LPT1
  2534.                 01h     LPT2
  2535.                 02h     LPT3
  2536. return  AH      status byte
  2537.            bits 0       time out
  2538.                 1       unused
  2539.                 2       unused
  2540.                 3       I/O error
  2541.                 4       printer selected
  2542.                 5       out of paper
  2543.                 6       acknowledge
  2544.                 7       not busy
  2545.  
  2546.  
  2547. Function 01h    Initialize Printer
  2548.                 Set init line low, send 0Ch to printer DX
  2549. entry   AH      01h
  2550.         DX      printer port to be initialized (0,1,2)
  2551. return  status as below
  2552.  
  2553.  
  2554. Function  02h   Printer Status
  2555.                 Read status of printer DX into AH
  2556. entry   AH      02h
  2557.         DX      printer port to be used (0,1,2)
  2558. return  AH      status byte
  2559.            bits 7       0       busy/paused: the printer cannot
  2560.                                 immediately take more data because it
  2561.                                 is in the middle of accepting a
  2562.                                 character, printing a line, is
  2563.                                 offline, or it is in error status.
  2564.                         1       ready
  2565.                 6   ACKnowledge line toggled: reflects the state of
  2566.                     the ACK line on the printer port at the moment the
  2567.                     status was read.  ACK is a strobe: it goes low for
  2568.                     a very short time (12 microseconds on an Epson)
  2569.                     when the printer is ready for another character.
  2570.                     As far as printer status is concerned, this is
  2571.                     useless; it's only useful for something like an
  2572.                     interrupt-driven interface.  Most of the time,
  2573.                     you'll see ACK high (bit 6 on), but occasionally,
  2574.                     if you check status just after sending a character,
  2575.                     you might see it low.  ACK is low when the printer
  2576.                     is powered off.
  2577.                 5   out-of-paper line toggled
  2578.                 4   printer selected: printer is selected, ready, 
  2579.                     or, online.  There is usually a button on the
  2580.                     printer to control this.
  2581.                 3   I/O error: offline, out of paper or other error
  2582.                     condition such as out of ribbon.
  2583.                 2   unused
  2584.                 1   unused
  2585.                 0   timeout error: printer failed to send ACK and
  2586.                     drop busy after being sent a character.
  2587. note 1) You can expect to see these states in a properly functioning
  2588.         printer:
  2589.         Normal                Offline                Power off
  2590.         ======                =======                =========
  2591.         not busy/paused       busy/paused            busy/paused
  2592.         not out of paper      not out of paper       not out of paper
  2593.         selected/online       not selected/online    not selected/online
  2594.         not I/O error         I/O error (usually)    I/O error
  2595.         not timeout error     not timeout error      not timeout error
  2596.      2) Not all printers return the status codes properly.  That's OK,
  2597.         not all clone BIOSes do it right either.  If your program
  2598.         depends on the return codes, you might want to make the code
  2599.         easily patched or configured for nonstandard hardware.
  2600.  
  2601.  
  2602. Function   03h  Versa-Spool print spooler
  2603. entry   AH      03h     Versa-Spool
  2604.         AL      00h     Return Signature
  2605.                 01h     Toggle Pause
  2606.                 02h     Clear Buffer
  2607.                 03h     Request Pause Condition
  2608.                 04h     Request Free Buffer Space
  2609.                 05h     Request Total Buffer Size
  2610.                 06h     Redirect Output to LPT1
  2611.                 07h     Redirect Output to LPT2
  2612.                 08h     Redirect Output to LPT3
  2613.                 09h     Request Output Device
  2614.                 0Ah     Request Output Speed
  2615.                 0Bh     Request Device Spooled Status
  2616.  
  2617. return  (AH=00h)        AX      1234h   if Versa-Spool is installed
  2618.                                         undefined if not installed
  2619.         (AH=01h)        AX      0001h   if paused
  2620.                                 0000h   if resumed
  2621.         (AH=02h)        AX      0302h   not cleared
  2622.                                 0000h   cleared
  2623.         (AH=03h)        AX      0001h   if paused
  2624.                                 0000h   if resumed
  2625.         (AH=04h)        AX      remaining buffer space (in Kbytes)
  2626.         (AH=05h)        AX      total buffer space (in Kbytes)
  2627.         (AH=06h)        AX      nothing
  2628.         (AH=07h)        AX      nothing
  2629.         (AH=08h)        AX      nothing
  2630.         (AH=09h)        AX      printer output (0..2)
  2631.         (AH=0Ah)        AX      output speed in CPS
  2632.         (AH=0Bh)        AX      0001h   is spooled
  2633.                                 0000h   otherwise
  2634.  
  2635.  
  2636. Function  03h   Print String                             (PC-MOS/386)
  2637.         Print an entire string with one interrupt call
  2638. entry   AH      03h
  2639.         CX      number of characters in string
  2640.         DX      printer port number
  2641.         DS:SI   pointer to string
  2642. return  AH      status code (same as PC BIOS)
  2643.         CX      number of characters printed
  2644. note 1) Any redirection set up with the MOS ROUTE command or
  2645.         SPOOL.COM will be in effect.
  2646.      2) Some serial terminals so not provide printer status feedback.
  2647.  
  2648.  
  2649. Function  0C0h  PC Magazine PCSPOOL - get printer status
  2650. entry   AH      0C0h
  2651.         DX      printer port to be used (0,1,2)
  2652. return  ES:BX   address of printer control block
  2653. note    PC Magazine, January 15, 1991. (Vol 10, Number 1)
  2654.  
  2655.  
  2656. Function  0C1h  PC Magazine PCSPOOL - add pause to spool queue
  2657. entry   AH      0C1h
  2658.         DX      printer port to be used (0,1,2)
  2659.         DS:SI   pointer to ASCIIZ string to display
  2660. return  AH      printer status
  2661.  
  2662.  
  2663. Function  0C2h  PC Magazine PCSPOOL - flush queue record
  2664. entry   AH      0C2h
  2665.         DX      printer port to be used (0,1,2)
  2666. return  AH      printer status
  2667.  
  2668.  
  2669. Function  0C3h  PC Magazine PCSPOOL - cancel printer queue
  2670. entry   AH      0C3h
  2671.         DX      printer port to be used (0,1,2)
  2672. return  AH      printer status
  2673.  
  2674.  
  2675. Function  0C4h  PC Magazine PCSPOOL - determine of spooler is active
  2676. entry   AH      0C4h
  2677. return  DI      0B0BFh  if PCSPOOL is loaded
  2678.         SI      segment of the PSP of the active PCSPOOL
  2679.  
  2680.  
  2681. ┌─────────────────────────────────────────────────────────────────────┐
  2682. │Interrupt 18h  ROM BASIC                                       3**11 │
  2683. └─────────────────────────────────────────────────────────────────────┘
  2684. (0:0060h)       Execute ROM BASIC at address 0F600h:0000h
  2685. entry   no parameters used
  2686. return  jumps into ROM BASIC on IBM systems
  2687. note 1) Often reboots a compatible.
  2688.      2) Used by Turbo C 1.5. 2.0 and later do not use it.
  2689.      3) On IBM systems, this interrupt is called if disk boot failure
  2690.         occurs.
  2691.      4) Video interrupt on DEC Rainbow.
  2692.      5) Digital Research's ROM-based implementation of DR-DOS uses int
  2693.         18h as the initial entry vector into the operating system code.
  2694.         Note that some clone BIOSes may not properly implement int 18h
  2695.         in the ROM and use of DR-DOS ROMs may not always work.
  2696.      6) Maxon 286/HD laptop: called by BIOS power management routines
  2697.         to communicate with applications.
  2698.  
  2699.  
  2700.  
  2701. ┌─────────────────────────────────────────────────────────────────────┐
  2702. │Interrupt 19h  Bootstrap Loader / Extended Memory VDISK ID     3**12 │
  2703. └─────────────────────────────────────────────────────────────────────┘
  2704. (0:0064h)
  2705. entry   no parameters used
  2706. return  none
  2707. note 1) Reads track 0, sector 1 into address 0000h:7C00h, then
  2708.         transfers control to that address.  If no diskette drive is
  2709.         available, scans memory from C:000 to F:000 for a valid hard
  2710.         disk or other ROM. If none, transfers to ROM-BASIC via int 18h
  2711.         or displays loader error message.
  2712.      2) Causes reboot of disk system if invoked while running.
  2713.         (no memory test performed).
  2714.      3) If location 0000:0472h does not contain the value 1234h, a
  2715.         memory test (POST) will be performed before reading the boot
  2716.         sector.
  2717.      4) VDISK from DOS 3.0+ traps this vector to determine when the
  2718.         CPU has shifted from protected mode to real mode.  A detailed
  2719.         discussion can be found by Ray Duncan in PC Magazine, May 30,
  2720.         1989.
  2721.      5) Reportedly, some versions of DOS 2.x and all versions of DOS
  2722.         3.x+ intercept int 19h in order to restore some interrupt
  2723.         vectors DOS takes over, in order to put the machine back to a
  2724.         cleaner state for the reboot, since the POST will not be run on
  2725.         the int 19h.  These vectors are reported to be: 02h, 08h, 09h,
  2726.         0Ah, 0Bh, 0Ch, 0Dh, 0Eh, 70h, 72h, 73h, 74h, 75h, 76h, and 77h.
  2727.         After restoring these, it restores the original int 19h vector
  2728.         and calls int 19h.
  2729.      6) The system checks for installed ROMs by searching memory from
  2730.         0C000h to the beginning of the BIOS, in 2k chunks.  ROM memory
  2731.         is identified if it starts with the word 0AA55h.  It is
  2732.         followed a one byte field length of the ROM (divided by 512).
  2733.         If ROM is found, the BIOS will call the ROM at an offset of 3
  2734.         from the beginning.  This feature was not supported in the
  2735.         earliest PC machines.  The last task turns control over to the
  2736.         bootstrap loader (assuming the floppy controller is
  2737.         operational).
  2738.      7) 8255 port 60h bit 0 = 1 if booting from diskette.
  2739.      8) All IBM BIOSes and most clone BIOSes will try to boot from
  2740.         floppy A: if no other boot device is present.  Some machines
  2741.         (notably mil-spec Zeniths) have a jumper to prohibit booting
  2742.         from floppy at all, for "security reasons".  Many Tandy
  2743.         machines will try to boot from drive B: if the F2 key is held
  2744.         down during POST.  With a CompatiCard floppy controller you
  2745.         can boot off ANY drive.
  2746.      9) Phoenix BIOSes with password protection enabled use this call
  2747.         for the password routine.
  2748.     10) With early versions of DOS 5.0, int 19h fails with EMM386.EXE
  2749.         loaded and and DOS=HIGH in CONFIG.SYS
  2750.  
  2751.  
  2752. ┌─────────────────────────────────────────────────────────────────────┐
  2753. │Interrupt 1Ah  Time of Day                                     3**13 │
  2754. └─────────────────────────────────────────────────────────────────────┘
  2755.  
  2756. (0:0068h)    1) Accesses the PC internal clock.
  2757.              2) This interrupt is not supported on some machines, such
  2758.                 as the HP150 PC.
  2759.              3) Some "turbo" BIOSes run the clock slower than normal in
  2760.                 order to throw off benchmark software, which usually
  2761.                 uses int 1Ah for timekeeping.
  2762.              4) Counts occur at the rate of 1193180/65536 counts/sec
  2763.                 (about 18.2 per second).
  2764.  
  2765. Function 00h    Read System Timer Tick Counter            (except PC)
  2766. entry   AH      00h
  2767. return  AL      00h     if clock was read or written (via AH=0,1)
  2768.                         within the current 24-hour period.
  2769.                 <>0     midnight was passed since last read
  2770.         CX:DX   32-bit tick count (high 16 bits in CX)
  2771. note 1) The returned value is the cumulative number of clock ticks
  2772.         since midnight.  There are 18.2 clock ticks per second, or one
  2773.         every 54.92ms.  When the counter reaches 1,573,040, it is
  2774.         cleared to zero, and the rollover flag is set.
  2775.      2) The rollover flag is cleared by this function call, so the
  2776.         flag will only be returned nonzero once per day.
  2777.      3) Int 1Ah/fn 01h can be used to set the counter to an arbitrary
  2778.         32 bit value.
  2779.      4) This function does not return seconds/100 in DL. The best you
  2780.         can do is set it to zero (or any value <=99).  This means that
  2781.         your DOS clock could be up to 1 second off from the BIOS
  2782.         clock, however the effect is not cumulative.
  2783.  
  2784.  
  2785. Function 01h    Set Clock Tick Counter Value              (except PC)
  2786. entry   AH      01h
  2787.         CX:DX   32-bit high word/low word count of timer ticks
  2788. return  none
  2789. note 1) The clock ticks are incremented by timer interrupt at 18.2065
  2790.         times per second or 54.9254 milliseconds/count. Therefore:
  2791.                 counts per second   18      (12h)
  2792.                 counts per minute   1092    (444h)
  2793.                 counts per hour     65543   (10011h)
  2794.                 counts per day      1573040 (1800B0h)
  2795.      2) The counter is zeroed when system is rebooted.
  2796.      3) Stores a 32-bit value in the clock tick counter.
  2797.      4) The rollover flag is cleared by this call.
  2798.  
  2799.  
  2800. Function 02h    Read Real Time Clock Time
  2801.                 (AT and after)
  2802. entry   AH      02h
  2803. return  CH      hours in BCD
  2804.         CL      minutes in BCD
  2805.         DH      seconds in BCD
  2806.         DL      00h     standard time
  2807.                 01h     daylight savings time
  2808.         CF      0       if clock running
  2809.                 1       if clock not operating
  2810. note 1) Reads the current time from the CMOS time/date chip.
  2811.      2) Also for Leading Edge Model M.
  2812.      3) According to Phoenix this call will fail if the BIOS is
  2813.         "updating" its clock value.  You should check the carry flag
  2814.         and retry if it is set following the call.
  2815.  
  2816.  
  2817. Function 03h    Set Real Time Clock Time
  2818.                 (AT and after)
  2819. entry   AH      03h
  2820.         CH      hours in BCD
  2821.         CL      minutes in BCD
  2822.         DH      seconds in BCD
  2823.         DL      0 (clear) if standard time
  2824.                 1 (set)   if daylight savings time option
  2825. return  none
  2826. note 1) Sets the time in the CMOS time/date chip.
  2827.      2) Also for Leading Edge Model M.
  2828.  
  2829.  
  2830. Function 04h    Read Real Time Clock Date
  2831.                 (AT and after)
  2832. entry   AH      04h
  2833. return  CH      century in BCD (19 or 20)
  2834.         CL      year in BCD
  2835.         DH      month in BCD
  2836.         DL      day in BCD
  2837.         CF      0 (clear) if clock is running
  2838.                 1 (set)   if clock is not operating
  2839. note 1) Reads the current date from the CMOS time/date chip.
  2840.      2) Also for Leading Edge Model M.
  2841.  
  2842.  
  2843. Function 05h    Set Real Time Clock Date
  2844.                 (AT and after)
  2845. entry   AH      05h
  2846.         CH      century in BCD (19 or 20)
  2847.         CL      year in BCD
  2848.         DH      month in BCD
  2849.         DL      day in BCD
  2850. return  none
  2851. note 1) Sets the date in the CMOS time/date chip.
  2852.      2) Also for Leading Edge Model M with Leading Edge DOS 2.11.
  2853.  
  2854.  
  2855. Function 06h    Set Real Time Clock Alarm
  2856.                 (AT and after)
  2857. entry   AH      06h
  2858.         CH      hours in BCD
  2859.         CL      minutes in BCD
  2860.         DH      seconds in BCD
  2861. return  CF      set if alarm already set or clock inoperable
  2862. note 1) Sets alarm in the CMOS date/time chip.  Int 4Ah occurs at the
  2863.         specified alarm time every 24hrs until reset with Int 1Ah
  2864.         function 07h.
  2865.      2) A side effect of this function is that the clock chip's
  2866.         interrupt level (IRQ8) is enabled.
  2867.      3) Only one alarm may be active at any given time.
  2868.      4) The program using this function must place the address of its
  2869.         interrupt handler for the alarm in the vector for Int 4Ah.
  2870.  
  2871.  
  2872. Function 07h    Reset Real Time Clock Alarm
  2873.                 (AT and after)
  2874. entry   AH      07h
  2875. return  none
  2876. note 1) Cancels any pending alarm request on the CMOS date/time chip.
  2877.      2) This function does not disable the clock chip's interrupt
  2878.         level (IRQ8).
  2879.  
  2880.  
  2881. Function 08h    Set Real Time Clock Activated Power On Mode
  2882.                 (Convertible)
  2883. entry   AH      08h
  2884.         CH      hours in BCD
  2885.         CL      minutes in BCD
  2886.         DH      seconds in BCD
  2887.  
  2888.  
  2889. Function 09h    Read Real Time Clock Alarm Time and Status
  2890.                 (Convertible and PS/2 Model 30)
  2891. entry   AH      09h
  2892. return  CH      hours in BCD
  2893.         CL      minutes in BCD
  2894.         DH      seconds in BCD
  2895.         DL      alarm status:
  2896.                 00h     if alarm not enabled
  2897.                 01h     if alarm enabled but will not power up system
  2898.                 02h     if alarm will power up system
  2899.  
  2900.  
  2901. Function 0Ah    Read System-Timer Day Counter
  2902.                 (PS/2)
  2903. entry   AH      0Ah
  2904. return  CF      set on error
  2905.         CX      count of days since Jan 1,1980
  2906. note    Returns the contents of the system's day counter.
  2907.  
  2908.  
  2909. Function 0Bh    Set System-Timer Day Counter
  2910.                 (PS/2)
  2911. entry   AH      0Bh
  2912.         CX      count of days since Jan 1,1980
  2913. return  CF      set on error
  2914. note    Stores an arbitrary value in the system's day counter.
  2915.  
  2916.  
  2917. Function 80h    Set Up Sound Multiplexor
  2918.                 (PCjr) (Tandy 1000?)
  2919. entry   AH      80h
  2920.         AL      sound source
  2921.                 00h     source is 8253 timer chip, channel 2
  2922.                 01h     source is cassette input
  2923.                 02h     source is I/O channel "audio in" line
  2924.                 03h     source is TI sound generator chip
  2925. return  none
  2926. note    Sets up the source for tones that will appear on the PCjr's
  2927.         Audio Out bus line or RF modulator.
  2928.  
  2929.  
  2930. Function 81h    Get Sound status                    (Tandy 1000RL)
  2931.         parameters unknown
  2932.  
  2933.  
  2934. Function 82h    Input Sound (from the microphone)   (Tandy 1000RL)
  2935.         parameters unknown
  2936.  
  2937.  
  2938. Function 83h    Output Sound (to the speaker)       (Tandy 1000RL)
  2939.         parameters unknown
  2940.  
  2941.  
  2942. Function 84h    Stop Sound input and output          (Tandy 1000RL)
  2943.         parameters unknown
  2944.  
  2945.  
  2946. Function 1Ah    Read Time and Date                      (AT&T 6300)
  2947. entry   AH      0FEh
  2948. return  BX      days count (1=Jan 1, 1984)
  2949.         CH      hours
  2950.         CL      minutes
  2951.         DH      seconds
  2952.         DL      hundredths
  2953. note    Day count in BX is unique to AT&T/Olivetti computers.
  2954.  
  2955.  
  2956.  
  2957. ┌─────────────────────────────────────────────────────────────────────┐
  2958. │Interrupt 1Bh  Control-Break                                   3**14 │
  2959. └─────────────────────────────────────────────────────────────────────┘
  2960. (0:006Ch)       This interrupt is called when the keyboard handler
  2961.                 detects Ctrl and Break pressed at the same time.  DOS
  2962.                 normally points this interrupt at its own Ctrl-Break
  2963.                 handler.
  2964.  
  2965. note 1) If the break occurred while processing an interrupt, one or
  2966.         more end of interrupt commands must be send to the 8259
  2967.         Programmable Interrupt Controller.
  2968.      2) All I/O devices should be reset in case an operation was
  2969.         underway at the time.
  2970.      3) It is normally pointed to an IRET during system initialization
  2971.         so that it does nothing, but some programs change it to return
  2972.         a Ctrl-C scan code and thus invoke int 23h.
  2973.  
  2974.  
  2975.  
  2976. ┌─────────────────────────────────────────────────────────────────────┐
  2977. │Interrupt 1Ch  Timer Tick                                      3**15 │
  2978. └─────────────────────────────────────────────────────────────────────┘
  2979. (0:0070h)
  2980. note 1) Taken 18.2065 times per second by the int 08h interrupt.
  2981.      2) Normally vectors to dummy IRET unless PRINT.COM has been
  2982.         installed.
  2983.      3) If an application moves the interrupt pointer, it is the
  2984.         responsibility of that application to save and restore all
  2985.         registers that may be modified.
  2986.      4) returns values at absolute address 40:6x (BIOS Data Area);
  2987.         number of ticks since midnight
  2988.         40:6C   word    timer counter high word
  2989.         40:6E   word    timer counter low word
  2990.      5) Ventura Publisher 2.0 grabs this interrupt and does not pass
  2991.         subsequent vector reassignments along.  This causes problems
  2992.         with some TSRs and network software.
  2993.      6) When installing a user interrupt for int 1Ch, the external
  2994.         interrupts must be disabled before the vector is altered.  If a
  2995.         timer interrupt occurs between the setting of the offset and
  2996.         segment, an incorrect address will result.
  2997.  
  2998.  
  2999. ┌─────────────────────────────────────────────────────────────────────┐
  3000. │Interrupt 1Dh  Vector of Video Initialization Parameters       3**16 │
  3001. └─────────────────────────────────────────────────────────────────────┘
  3002. (0:0074h)       This doubleword address points to 3 sets of 16 bytes
  3003.                 containing data to initialize for video modes for video
  3004.                 modes 0 & 1 (40 column), 2 & 3 (80 column), and 4, 5 &
  3005.                 6 (graphics) on the Motorola 6845 CRT controller chip.
  3006.  6845 registers:
  3007.         R0      horizontal total          (horizontal sync in characters)
  3008.         R1      horizontal displayed                (characters per line)
  3009.         R2      horizontal sync position     (move display left or right)
  3010.         R3      sync width   (vertical and horizontal pulse: 4-bits each)
  3011.         R4      vertical total                    (total character lines)
  3012.         R5      vertical adjust          (adjust for 50 or 60 Hz refresh)
  3013.         R6      vertical displayed             (lines of chars displayed)
  3014.         R7      vertical sync position         (lines shifted up or down)
  3015.         R8      interlace (bits 4 and 5) and skew (bits 6 and 7)
  3016.         R9      max scan line addr         (scan lines per character row)
  3017.         R10     cursor start               (starting scan line of cursor)
  3018.         R11     cursor stop                  (ending scan line of cursor)
  3019.         R12     video memory start address high byte             (6 bits)
  3020.         R13     video memory start address low byte              (8 bits)
  3021.         R14     cursor address high byte                         (6 bits)
  3022.         R15     cursor address low byte                          (8 bits)
  3023.  
  3024.  6845 Video Init Tables:
  3025.         table for modes 0 and 1   \
  3026.         table for modes 2 and 3    \ each table is 16 bytes long and
  3027.         table for modes 4,5, and 6 / contains values for 6845 registers
  3028.         table for mode 7          /
  3029.       4 words   size of video RAM for modes 0/1, 2/3, 4/5, and 6/7
  3030.       8 bytes   number of columns in each mode
  3031.       8 bytes   video controller mode byte for each mode
  3032. note 1) There are four separate tables, and all four must be
  3033.         initialized if all  video modes will be used.
  3034.      2) The power-on initialization code of the computer points this
  3035.         vector to the ROM BIOS video routines.
  3036.      3) IBM recommends that if this table needs to be modified, it
  3037.         should be copied into RAM and only the necessary changes made.
  3038.  
  3039.  
  3040.  
  3041.  
  3042. ┌─────────────────────────────────────────────────────────────────────┐
  3043. │Interrupt 1Eh  Vector of Diskette Controller Parameters        3**17 │
  3044. └─────────────────────────────────────────────────────────────────────┘
  3045. (0:0078h)       Dword address points to data base table that is used by
  3046.                 BIOS.  Default location is at 0F000:0EFC7h.  11-byte
  3047.                 table format:
  3048.           bytes:
  3049.                 00h     4-bit step rate, 4-bit head unload time
  3050.                 01h     7-bit head load time, 1-bit DMA flag
  3051.                 02h     54.9254 ms ticks - delay til motor off (36-38
  3052.                         typical)
  3053.                 03h     sector size:
  3054.                         00h     128 bytes
  3055.                         01h     256 bytes
  3056.                         02h     512 bytes
  3057.                         03h     1024 bytes
  3058.                 04h     last sector on track            (8 or 9 typical)
  3059.                 05h     inter-sector gap on read/write      (42 typical)
  3060.                 06h     data length for DMA transfers     (0FFh typical)
  3061.                 07h     gap length between sectors for format   (80 typ)
  3062.                 08h     sector fill byte for format       (0F6h typical)
  3063.                 09h     head settle time (in milliseconds)
  3064.                                                       (15 to 25 typical)
  3065.                         DOS 1.0   0
  3066.                         DOS 1.10  0
  3067.                         DOS 2.10  15
  3068.                         DOS 3.1   1
  3069.                 0Ah     motor start time (in 1/8 sec intervals)
  3070.                         (2-4 typical)
  3071.                         DOS 2.10  2
  3072. note 1) This vector is pointed to the ROM BIOS diskette tables on
  3073.         system initialization
  3074.      2) IBM recommends that if this table needs to be modified, it
  3075.         should be copied into RAM and only the necessary changes made.
  3076.      3) Some versions of DOS 3.2 may contain a bug.  DOS 3.2 assumes
  3077.         that the dword at 0070:0F37 contains the address of the
  3078.         diskette parameter block and changes values in that block.  The
  3079.         location does contain a copy of the value at 0:78 (int 1Eh,
  3080.         DISK_POINTER) if DOS is booted from diskette, but when booted
  3081.         from the hard disk, the location contains 0:0.  This leads to
  3082.         strange things, especially when running under a debugger since
  3083.         DOS overwrites parts of the interrupt vectors for interrupts 1
  3084.         to 3.  The solution to the problem is to either upgrade to DOS
  3085.         3.3 or to copy the disk parameter vector to 70:0F37 before
  3086.         running or at the start of your program.
  3087.  
  3088.  
  3089.  
  3090. ┌─────────────────────────────────────────────────────────────────────┐
  3091. │Interrupt 1Fh  Ptr to Graphic Char Extensions (Graphics Set 2) 3**18 │
  3092. └─────────────────────────────────────────────────────────────────────┘
  3093. (0:007Ch)       This is the pointer to data used by the ROM video
  3094.                 routines to display characters above ASCII 127 while in
  3095.                 CGA medium and high res graphics modes.
  3096.  
  3097. note 1) Doubleword address points to 1K table composed of 28 8-byte
  3098.         character definition bit-patterns.  First byte of each entry is
  3099.         top row, last byte is bottom row.
  3100.      2) The first 128 character patterns are located in system ROM.
  3101.      3) This vector is set to 000:0 at system initialization.
  3102.      4) Used by DOS' external GRAFTABL command.
  3103.  
  3104.  
  3105.  
  3106.